Skip to contentSkip to conversation

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

PATCH In review Wei Yongjun 3 participants 3 messages Nov 1, 2021 – Nov 20, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe()

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")
---
 drivers/crypto/keembay/keembay-ocs-ecc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/keembay/keembay-ocs-ecc.c +1 -0
index 679e6ae295e0..5d0785d3f1b5 100644
@@ -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;
 	}
 
Reviewed-by on v1 1/1
#1 lore raw

Hi Wei,

Quoted 9 lines · Wei Yongjun

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

---
 drivers/crypto/keembay/keembay-ocs-ecc.c | 1 +

 1 file changed, 1 insertion(+)

Thanks for the fix!

Quoted 14 lines
drivers/crypto/keembay/keembay-ocs-ecc.c +1 -0
index 679e6ae295e0..5d0785d3f1b5 100644
@@ -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;
         }

maintainer
#2 lore raw
In reply to Wei Yongjun
Quoted 9 lines · Wei Yongjun

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")
---
 drivers/crypto/keembay/keembay-ocs-ecc.c | 1 +
 1 file changed, 1 insertion(+)

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