summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2021-05-08 15:00:49 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:56:03 +0200
commit45d2d67833ae72a145560cfb6ba30c02a10642ad (patch)
tree86764e08cf3b75cfd4c36eb5245b9555b9a09cd0 /drivers/crypto
parent8c8c11b4df706307248d0ab637f2601b2520edc0 (diff)
downloadlinux-stable-45d2d67833ae72a145560cfb6ba30c02a10642ad.tar.gz
linux-stable-45d2d67833ae72a145560cfb6ba30c02a10642ad.tar.bz2
linux-stable-45d2d67833ae72a145560cfb6ba30c02a10642ad.zip
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')
-rw-r--r--drivers/crypto/ux500/hash/hash_core.c1
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 3d407eebb2ba..1e2daf403032 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -1009,6 +1009,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;