Skip to contentSkip to conversation

crypto: ux500 - Fix error return code in hash_hw_final()

PATCH In review Zhen Lei 3 participants 3 messages May 8, 2021 – May 14, 2021 Crypto API

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 crypto: ux500 - Fix error return code in hash_hw_final()

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

Fixes 8a63b1994c50 ("crypto: ux500 - Add driver for HASH hardware")
---
 drivers/crypto/ux500/hash/hash_core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/ux500/hash/hash_core.c +1 -0
index ecb7412e84e3..51a6e1a42434 100644
@@ -1011,6 +1011,7 @@ static int hash_hw_final(struct ahash_request *req)
 			goto out;
 		}
 	} else if (req->nbytes == 0 && ctx->keylen > 0) {
+		ret = -EPERM;
 		dev_err(device_data->dev, "%s: Empty message with keylength > 0, NOT supported\n",
 			__func__);
 		goto out;
Signature · 1 line
2.25.1
maintainer
#2 lore raw
In reply to Zhen Lei
Quoted 9 lines · Zhen Lei

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

Fixes 8a63b1994c50 ("crypto: ux500 - Add driver for HASH hardware")
---
 drivers/crypto/ux500/hash/hash_core.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