crypto: drbg - fix an error code in drbg_init_sym_kernel()
Subsystems (2)
PATCH 1/1 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.
crypto/drbg.c +1 -1
@@ -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,
Am Freitag, 17. Juni 2016, 12:16:19 schrieb Dan Carpenter:
Hi Dan,
Quoted 5 lines
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 <[email protected]>
That points to an error in the documentation of skcipher_request_alloc.
I will send a follow-up patch.
Quoted 6 lines
crypto/drbg.c +0
-0
crypto/drbg.c static int drbg_init_sym_kernel(struct drbg_state · line 1692
Quoted 8 lines
crypto/drbg.c +1
-1@@ -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,
Ciao
Stephan
Am Freitag, 17. Juni 2016, 11:19:58 schrieb Stephan Mueller:
Hi Stephan,
Quoted 7 lines
Am Freitag, 17. Juni 2016, 12:16:19 schrieb Dan Carpenter:
Hi Dan,
Quoted 3 lines
We accidentally return
PTR_ERR(NULL)which is success but we should return-ENOMEM.
Quoted 6 lines
Quoted 2 lines
Fixes 355912852115 ('crypto: drbg - use CTR AES instead of ECB AES')Signed-off-by Dan Carpenter <[email protected]>Acked-by Stephan Mueller <[email protected]>That points to an error in the documentation of
skcipher_request_alloc.
Apologies, that documentation issue has already been fixed in the cryptodev-2.6 tree. I was looking at the vanilla 4.6 tree for the documentation while I was preparing my patch.
Ciao
Stephan
Herbert Xu
maintainerQuoted 5 lines · Dan Carpenter
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 <[email protected]>
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt