Skip to content

Commit

Permalink
crypto: drbg - fix an error code in drbg_init_sym_kernel()
Browse files Browse the repository at this point in the history
We accidentally return PTR_ERR(NULL) which is success but we should
return -ENOMEM.

Fixes: 3559128 ('crypto: drbg - use CTR AES instead of ECB AES')
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Stephan Mueller <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
Dan Carpenter authored and herbertx committed Jun 20, 2016
1 parent 79cc6ab commit 01ac945
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg)
if (!req) {
pr_info("DRBG: could not allocate request queue\n");
drbg_fini_sym_kernel(drbg);
return PTR_ERR(req);
return -ENOMEM;
}
drbg->ctr_req = req;
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
Expand Down

0 comments on commit 01ac945

Please sign in to comment.