提交 f283148a 编写于 作者: C Colin Ian King 提交者: Herbert Xu

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: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 012ef703
...@@ -878,7 +878,7 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm, ...@@ -878,7 +878,7 @@ static int mtk_sha_setkey(struct crypto_ahash *tfm,
bctx->opad[i] ^= 0x5c; bctx->opad[i] ^= 0x5c;
} }
return err; return 0;
} }
static int mtk_sha_export(struct ahash_request *req, void *out) static int mtk_sha_export(struct ahash_request *req, void *out)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册