mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
crypto: ccp - Release all allocated memory if sha type is invalid
[ Upstream commit 128c664292 ]
Release all allocated memory if sha type is invalid:
In ccp_run_sha_cmd, if the type of sha is invalid, the allocated
hmac_buf should be released.
v2: fix the goto.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
@@ -1216,8 +1216,9 @@ static int ccp_run_sha_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
|
||||
digest_size);
|
||||
break;
|
||||
default:
|
||||
kfree(hmac_buf);
|
||||
ret = -EINVAL;
|
||||
goto e_ctx;
|
||||
goto e_data;
|
||||
}
|
||||
|
||||
memset(&hmac_cmd, 0, sizeof(hmac_cmd));
|
||||
|
||||
Reference in New Issue
Block a user