linux/drivers/crypto/ccp
Dinghao Liu a1c95dd5bc crypto: ccp - fix memleak in ccp_init_dm_workarea
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: 63b945091a ("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>
2023-12-08 11:45:27 +08:00
..
ccp-crypto-aes-cmac.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto-aes-galois.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto-aes-xts.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto-aes.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto-des3.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto-main.c crypto: ccp - Use request_complete helpers 2023-02-13 18:34:49 +08:00
ccp-crypto-rsa.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto-sha.c crypto: ccp - Set DMA alignment explicitly 2022-12-09 18:45:00 +08:00
ccp-crypto.h
ccp-debugfs.c
ccp-dev-v3.c
ccp-dev-v5.c
ccp-dev.c
ccp-dev.h crypto: ccp - fix typo in comment 2022-06-10 16:40:18 +08:00
ccp-dmaengine.c crypto: ccp - Failure on re-initialization due to duplicate sysfs filename 2023-01-20 18:29:31 +08:00
ccp-ops.c crypto: ccp - fix memleak in ccp_init_dm_workarea 2023-12-08 11:45:27 +08:00
dbc.c crypto: ccp - Add support for DBC over PSP mailbox 2023-09-15 18:29:46 +08:00
dbc.h crypto: ccp - Add support for DBC over PSP mailbox 2023-09-15 18:29:46 +08:00
Kconfig
Makefile crypto: ccp - Add support for fetching a nonce for dynamic boost control 2023-07-20 22:14:21 +12:00
platform-access.c crypto: ccp - Validate that platform access mailbox registers are declared 2023-06-02 18:21:32 +08:00
platform-access.h crypto: ccp - Add support for ringing a platform doorbell 2023-03-17 11:16:43 +08:00
psp-dev.c crypto: ccp - Add support for DBC over PSP mailbox 2023-09-15 18:29:46 +08:00
psp-dev.h crypto: ccp - Add support for DBC over PSP mailbox 2023-09-15 18:29:46 +08:00
sev-dev.c crypto: ccp - Dump SEV command buffer registers on SEV command error 2023-10-20 13:39:26 +08:00
sev-dev.h crypto: ccp - Move some PSP mailbox bit definitions into common header 2023-03-17 11:16:43 +08:00
sp-dev.c
sp-dev.h crypto: ccp - Add a macro to check capabilities register 2023-09-15 18:29:46 +08:00
sp-pci.c crypto: ccp - Add a macro to check capabilities register 2023-09-15 18:29:46 +08:00
sp-platform.c crypto: ccp/sp - Convert to platform remove callback returning void 2023-10-27 18:04:26 +08:00
tee-dev.c crypto: ccp - Move direct access to some PSP registers out of TEE 2023-09-15 18:29:45 +08:00
tee-dev.h crypto: ccp - Move direct access to some PSP registers out of TEE 2023-09-15 18:29:45 +08:00