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: 3559128521 ('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>
This commit is contained in:
Dan Carpenter 2016-06-17 12:16:19 +03:00 committed by Herbert Xu
parent 79cc6ab894
commit 01ac94580a

View file

@ -1686,7 +1686,7 @@ static int drbg_init_sym_kernel(struct drbg_state *drbg)
if (!req) { if (!req) {
pr_info("DRBG: could not allocate request queue\n"); pr_info("DRBG: could not allocate request queue\n");
drbg_fini_sym_kernel(drbg); drbg_fini_sym_kernel(drbg);
return PTR_ERR(req); return -ENOMEM;
} }
drbg->ctr_req = req; drbg->ctr_req = req;
skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG, skcipher_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,