summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/mediatek
diff options
context:
space:
mode:
authorColin Ian King2017-01-03 14:21:22 +0100
committerHerbert Xu2017-01-12 17:24:42 +0100
commitf283148a0774e9b2de5ae4b42bb7dff50410f8cc (patch)
treec95be39d2b3901e80484c120a2603556843ba165 /drivers/crypto/mediatek
parentcrypto: picoxcell - Remove spacc_is_compatible() wrapper function (diff)
downloadkernel-qcow2-linux-f283148a0774e9b2de5ae4b42bb7dff50410f8cc.tar.gz
kernel-qcow2-linux-f283148a0774e9b2de5ae4b42bb7dff50410f8cc.tar.xz
kernel-qcow2-linux-f283148a0774e9b2de5ae4b42bb7dff50410f8cc.zip
crypto: mediatek - don't return garbage err on successful return
In the case where keylen <= bs mtk_sha_setkey returns an uninitialized return value in err. Fix this by returning 0 instead of err. Issue detected by static analysis with cppcheck. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/mediatek')
-rw-r--r--drivers/crypto/mediatek/mtk-sha.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/mediatek/mtk-sha.c b/drivers/crypto/mediatek/mtk-sha.c
index 89513632c8ed..8e1b440fedf0 100644
--- a/drivers/crypto/mediatek/mtk-sha.c
+++ b/drivers/crypto/mediatek/mtk-sha.c
@@ -878,7 +878,7 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm,
bctx->opad[i] ^= 0x5c;
}
- return err;
+ return 0;
}
static int mtk_sha_export(struct ahash_request *req, void *out)