Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f283148a authored by Colin Ian King's avatar Colin Ian King Committed by Herbert Xu
Browse files

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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 012ef703
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)