diff mbox series

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

Message ID 20210508070049.2674-1-thunder.leizhen@huawei.com
State Accepted
Commit b01360384009ab066940b45f34880991ea7ccbfb
Headers show
Series [1/1] crypto: ux500 - Fix error return code in hash_hw_final() | expand

Commit Message

Leizhen (ThunderTown) May 8, 2021, 7 a.m. UTC
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 <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

---
 drivers/crypto/ux500/hash/hash_core.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.25.1

Comments

Linus Walleij May 9, 2021, 12:34 a.m. UTC | #1
On Sat, May 8, 2021 at 9:01 AM Zhen Lei <thunder.leizhen@huawei.com> 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 <hulkci@huawei.com>

> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>


Reviewed-by: Linus Walleij <linus.walleij@linaro.org>


Yours,
Linus Walleij
Herbert Xu May 14, 2021, 11:36 a.m. UTC | #2
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 <hulkci@huawei.com>

> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>

> ---

>  drivers/crypto/ux500/hash/hash_core.c | 1 +

>  1 file changed, 1 insertion(+)


Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
diff mbox series

Patch

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;