crypto: mediatek - don't return garbage err on successful return
authorColin Ian King <colin.king@canonical.com>
Tue, 3 Jan 2017 13:21:22 +0000 (13:21 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 12 Jan 2017 16:24:42 +0000 (00:24 +0800)
commitf283148a0774e9b2de5ae4b42bb7dff50410f8cc
treec95be39d2b3901e80484c120a2603556843ba165
parent012ef70336a0dfb33ebe30cd80ec86aa1fe61f79
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>
drivers/crypto/mediatek/mtk-sha.c