diff mbox series

[-next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe()

Message ID 20211101140233.777222-1-weiyongjun1@huawei.com (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series [-next] crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe() | expand

Commit Message

Wei Yongjun Nov. 1, 2021, 2:02 p.m. UTC
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(+)

Comments

Alessandrelli, Daniele Nov. 2, 2021, 10:11 a.m. UTC | #1
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;
>         }
>  
>
Herbert Xu Nov. 20, 2021, 4:27 a.m. UTC | #2
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.
diff mbox series

Patch

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