Skip to contentSkip to conversation

crypto: omap-des - fix error return code in omap_des_probe()

PATCH In review Wei Yongjun 2 participants 2 messages Sep 15, 2016 – Sep 22, 2016 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: omap-des - fix error return code in omap_des_probe()

From: Wei Yongjun <[email protected]>

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

Fixes f1b77aaca85a ("crypto: omap-des - Integrate with the crypto

engine framework")

---
 drivers/crypto/omap-des.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/crypto/omap-des.c +3 -1
index 2b20d96..a6f6553 100644
@@ -1081,8 +1081,10 @@ static int omap_des_probe(struct platform_device *pdev)
 
 	/* Initialize des crypto engine */
 	dd->engine = crypto_engine_alloc_init(dev, 1);
-	if (!dd->engine)
+	if (!dd->engine) {
+		err = -ENOMEM;
 		goto err_engine;
+	}
 
 	dd->engine->prepare_cipher_request = omap_des_prepare_req;
 	dd->engine->cipher_one_request = omap_des_crypt_req;
maintainer
#1 lore raw
Quoted 8 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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

Fixes f1b77aaca85a ("crypto: omap-des - Integrate with the crypto

engine framework")

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