kernel_samsung_a53x/drivers/crypto/ccp
Dinghao Liu 3eaff2ffb7 crypto: ccp - fix memleak in ccp_init_dm_workarea
[ Upstream commit a1c95dd5bc1d6a5d7a75a376c2107421b7d6240d ]

When dma_map_single() fails, wa->address is supposed to be freed
by the callers of ccp_init_dm_workarea() through ccp_dm_free().
However, many of the call spots don't expect to have to call
ccp_dm_free() on failure of ccp_init_dm_workarea(), which may
lead to a memleak. Let's free wa->address in ccp_init_dm_workarea()
when dma_map_single() fails.

Fixes: 63b945091a07 ("crypto: ccp - CCP device driver and interface support")
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 12:12:26 +01:00
..
ccp-crypto-aes-cmac.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-aes-galois.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-aes-xts.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-aes.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-des3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-main.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-rsa.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto-sha.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-crypto.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-dev-v3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-dev-v5.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-dev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-dmaengine.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ccp-ops.c crypto: ccp - fix memleak in ccp_init_dm_workarea 2024-11-18 12:12:26 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psp-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
psp-dev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sev-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sev-dev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sp-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sp-dev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sp-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sp-platform.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tee-dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tee-dev.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00