public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel()
@ 2016-06-17  9:16 Dan Carpenter
  2016-06-17  9:19 ` Stephan Mueller
  2016-06-20 11:35 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2016-06-17  9:16 UTC (permalink / raw)
  To: Herbert Xu, Stephan Mueller
  Cc: David S. Miller, linux-crypto, linux-kernel, kernel-janitors

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>

diff --git a/crypto/drbg.c b/crypto/drbg.c
index ded8638..6872d15 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,

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel()
  2016-06-17  9:16 [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel() Dan Carpenter
@ 2016-06-17  9:19 ` Stephan Mueller
  2016-06-17  9:23   ` Stephan Mueller
  2016-06-20 11:35 ` Herbert Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Stephan Mueller @ 2016-06-17  9:19 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel,
	kernel-janitors

Am Freitag, 17. Juni 2016, 12:16:19 schrieb Dan Carpenter:

Hi Dan,

> 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>

That points to an error in the documentation of skcipher_request_alloc.

I will send a follow-up patch.
> 
> diff --git a/crypto/drbg.c b/crypto/drbg.c
> index ded8638..6872d15 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,


Ciao
Stephan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel()
  2016-06-17  9:19 ` Stephan Mueller
@ 2016-06-17  9:23   ` Stephan Mueller
  0 siblings, 0 replies; 4+ messages in thread
From: Stephan Mueller @ 2016-06-17  9:23 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel,
	kernel-janitors

Am Freitag, 17. Juni 2016, 11:19:58 schrieb Stephan Mueller:

Hi Stephan,

> Am Freitag, 17. Juni 2016, 12:16:19 schrieb Dan Carpenter:
> 
> Hi Dan,
> 
> > 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>
> 
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel()
  2016-06-17  9:16 [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel() Dan Carpenter
  2016-06-17  9:19 ` Stephan Mueller
@ 2016-06-20 11:35 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2016-06-20 11:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stephan Mueller, David S. Miller, linux-crypto, linux-kernel,
	kernel-janitors

On Fri, Jun 17, 2016 at 12:16:19PM +0300, Dan Carpenter wrote:
> 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>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-20 11:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17  9:16 [patch] crypto: drbg - fix an error code in drbg_init_sym_kernel() Dan Carpenter
2016-06-17  9:19 ` Stephan Mueller
2016-06-17  9:23   ` Stephan Mueller
2016-06-20 11:35 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox