2021-05-08 07:01:46

by Zhen Lei

[permalink] [raw]
Subject: [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")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhen Lei <[email protected]>
---
drivers/crypto/ux500/hash/hash_core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index ecb7412e84e3..51a6e1a42434 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -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;
--
2.25.1



2021-05-09 00:34:48

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/1] crypto: ux500 - Fix error return code in hash_hw_final()

On Sat, May 8, 2021 at 9:01 AM Zhen Lei <[email protected]> wrote:

> 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")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zhen Lei <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2021-05-14 11:37:35

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 1/1] crypto: ux500 - Fix error return code in hash_hw_final()

On Sat, May 08, 2021 at 03:00:49PM +0800, Zhen Lei wrote:
> 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")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zhen Lei <[email protected]>
> ---
> drivers/crypto/ux500/hash/hash_core.c | 1 +
> 1 file changed, 1 insertion(+)

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt