All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe()
@ 2021-11-01 14:02 Wei Yongjun
  2021-11-02 10:11 ` Alessandrelli, Daniele
  2021-11-20  4:27 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-11-01 14:02 UTC (permalink / raw)
  To: weiyongjun1, Daniele Alessandrelli, Prabhjot Khurana, Mark Gross,
	Herbert Xu, David S. Miller
  Cc: linux-crypto, kernel-janitors, Hulk Robot

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: c9f608c38009 ("crypto: keembay-ocs-ecc - Add Keem Bay OCS ECC Driver")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/crypto/keembay/keembay-ocs-ecc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/keembay/keembay-ocs-ecc.c b/drivers/crypto/keembay/keembay-ocs-ecc.c
index 679e6ae295e0..5d0785d3f1b5 100644
--- a/drivers/crypto/keembay/keembay-ocs-ecc.c
+++ b/drivers/crypto/keembay/keembay-ocs-ecc.c
@@ -930,6 +930,7 @@ static int kmb_ocs_ecc_probe(struct platform_device *pdev)
 	ecc_dev->engine = crypto_engine_alloc_init(dev, 1);
 	if (!ecc_dev->engine) {
 		dev_err(dev, "Could not allocate crypto engine\n");
+		rc = -ENOMEM;
 		goto list_del;
 	}
 


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

* Re: [PATCH -next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe()
  2021-11-01 14:02 [PATCH -next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe() Wei Yongjun
@ 2021-11-02 10:11 ` Alessandrelli, Daniele
  2021-11-20  4:27 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Alessandrelli, Daniele @ 2021-11-02 10:11 UTC (permalink / raw)
  To: mgross, Khurana, Prabhjot, weiyongjun1, herbert, davem
  Cc: linux-crypto, kernel-janitors, hulkci

Hi Wei,

On Mon, 2021-11-01 at 14:02 +0000, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: c9f608c38009 ("crypto: keembay-ocs-ecc - Add Keem Bay OCS ECC Driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/crypto/keembay/keembay-ocs-ecc.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com>

Thanks for the fix!

> 
> diff --git a/drivers/crypto/keembay/keembay-ocs-ecc.c b/drivers/crypto/keembay/keembay-ocs-ecc.c
> index 679e6ae295e0..5d0785d3f1b5 100644
> --- a/drivers/crypto/keembay/keembay-ocs-ecc.c
> +++ b/drivers/crypto/keembay/keembay-ocs-ecc.c
> @@ -930,6 +930,7 @@ static int kmb_ocs_ecc_probe(struct platform_device *pdev)
>         ecc_dev->engine = crypto_engine_alloc_init(dev, 1);
>         if (!ecc_dev->engine) {
>                 dev_err(dev, "Could not allocate crypto engine\n");
> +               rc = -ENOMEM;
>                 goto list_del;
>         }
>  
> 


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

* Re: [PATCH -next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe()
  2021-11-01 14:02 [PATCH -next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe() Wei Yongjun
  2021-11-02 10:11 ` Alessandrelli, Daniele
@ 2021-11-20  4:27 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2021-11-20  4:27 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Daniele Alessandrelli, Prabhjot Khurana, Mark Gross,
	David S. Miller, linux-crypto, kernel-janitors, Hulk Robot

On Mon, Nov 01, 2021 at 02:02:33PM +0000, Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: c9f608c38009 ("crypto: keembay-ocs-ecc - Add Keem Bay OCS ECC Driver")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/crypto/keembay/keembay-ocs-ecc.c | 1 +
>  1 file changed, 1 insertion(+)

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] 3+ messages in thread

end of thread, other threads:[~2021-11-20  4:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 14:02 [PATCH -next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe() Wei Yongjun
2021-11-02 10:11 ` Alessandrelli, Daniele
2021-11-20  4:27 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.