提交 e1aee610 编写于 作者: C Corentin Labbe 提交者: Zheng Zengkai

crypto: sun8i-ss - fix result memory leak on error path

stable inclusion
from stable-5.10.37
commit 1f12aaf07f61122cf5074d29714ee26f8d44b0e7
bugzilla: 51868
CVE: NA

--------------------------------

[ Upstream commit 1dbc6a1e ]

This patch fixes a memory leak on an error path.

Fixes: d9b45418 ("crypto: sun8i-ss - support hash algorithms")
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 baafb428
......@@ -437,8 +437,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq)
kfree(pad);
memcpy(areq->result, result, algt->alg.hash.halg.digestsize);
kfree(result);
theend:
kfree(result);
crypto_finalize_hash_request(engine, breq, err);
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册