diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2021-05-08 15:00:49 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 16:22:33 +0200 |
commit | 168a9051f0917accec4f5357c7f44f96f454ec53 (patch) | |
tree | c06c97a593874bae7941779c52b7ad903af84168 /drivers/crypto/ux500/hash/hash_core.c | |
parent | 886e46a6cde3ce4ab6df16cd228868182e766178 (diff) |
crypto: ux500 - Fix error return code in hash_hw_final()
[ Upstream commit b01360384009ab066940b45f34880991ea7ccbfb ]
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/crypto/ux500/hash/hash_core.c')
-rw-r--r-- | drivers/crypto/ux500/hash/hash_core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c index bca6b701c067..7021b5b49c03 100644 --- a/drivers/crypto/ux500/hash/hash_core.c +++ b/drivers/crypto/ux500/hash/hash_core.c @@ -1022,6 +1022,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; |