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>
This commit is contained in:
Colin Ian King 2017-01-03 13:21:22 +00:00 committed by Herbert Xu
parent 012ef70336
commit f283148a07
1 changed files with 1 additions and 1 deletions

View File

@ -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)