diff options
| author | 2026-01-29 15:10:16 +0000 | |
|---|---|---|
| committer | 2026-02-06 18:52:22 +0800 | |
| commit | ccb679fdae2e62ed92fd9acb25ed809c0226fcc6 (patch) | |
| tree | 7214f627e56cacddbc5e827d143ad4402986aa5e /include/linux/bcma/ssh:/git@git.zx2c4.com | |
| parent | crypto: xilinx - Fix inconsistant indentation (diff) | |
crypto: starfive - Fix memory leak in starfive_aes_aead_do_one_req()
The starfive_aes_aead_do_one_req() function allocates rctx->adata with
kzalloc() but fails to free it if sg_copy_to_buffer() or
starfive_aes_hw_init() fails, which lead to memory leaks.
Since rctx->adata is unconditionally freed after the write_adata
operations, ensure consistent cleanup by freeing the allocation in these
earlier error paths as well.
Compile tested only. Issue found using a prototype static analysis tool
and code review.
Fixes: 7467147ef9bf ("crypto: starfive - Use dma for aes requests")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/bcma/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
