crypto: drbg - fix an error code in drbg_init_sym_kernel()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 17 Jun 2016 09:16:19 +0000 (12:16 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 20 Jun 2016 11:25:03 +0000 (19:25 +0800)
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>
crypto/drbg.c

index 8b39f509f0a6e0c66bc45435f49ceb7b5be4caaf..f752da3a7c757672170efea3f1f0a20296e36cd7 100644 (file)
@@ -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,