crypto: sun8i-ss - Fix memory leak of pad
authorColin Ian King <colin.king@canonical.com>
Thu, 1 Apr 2021 15:18:27 +0000 (16:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:17 +0000 (09:50 +0200)
commit2c67a9333da9d0a3b87310e0d116b7c9070c7b00
tree5d5458611b10e45a3df8d60cf7700d389be5d6fd
parent2e57ffdb569602c7b5e574281de7d51a0b519b52
crypto: sun8i-ss - Fix memory leak of pad

[ Upstream commit 50274b01ac1689b1a3f6bc4b5b3dbf361a55dd3a ]

It appears there are several failure return paths that don't seem
to be free'ing pad. Fix these.

Addresses-Coverity: ("Resource leak")
Fixes: d9b45418a917 ("crypto: sun8i-ss - support hash algorithms")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c