summaryrefslogtreecommitdiffstats
path: root/crypto/drbg.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-06-17 12:16:19 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2016-06-20 19:25:03 +0800
commit01ac94580ac2f7076394212ca963da7409016796 (patch)
treea63a5ac8cfe33d6cf7120992013e0828cf881e2e /crypto/drbg.c
parent79cc6ab8947bd238b64afddc56ed84ee65f012ef (diff)
downloadlinux-01ac94580ac2f7076394212ca963da7409016796.tar.bz2
crypto: drbg - fix an error code in drbg_init_sym_kernel()
We accidentally return PTR_ERR(NULL) which is success but we should return -ENOMEM. Fixes: 355912852115 ('crypto: drbg - use CTR AES instead of ECB AES') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/drbg.c')
-rw-r--r--crypto/drbg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c
index 8b39f509f0a6..f752da3a7c75 100644
--- a/crypto/drbg.c
+++ b/crypto/drbg.c
@@ -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,