OpenCloudOS-Kernel/drivers/crypto/inside-secure
Nikita Zhandarovich 8084b788c2 crypto: safexcel - Add error handling for dma_map_sg() calls
[ Upstream commit 87e02063d07708cac5bfe9fd3a6a242898758ac8 ]

Macro dma_map_sg() may return 0 on error. This patch enables
checks in case of the macro failure and ensures unmapping of
previously mapped buffers with dma_unmap_sg().

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 49186a7d9e ("crypto: inside_secure - Avoid dma map if size is zero")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Reviewed-by: Antoine Tenart <atenart@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:16 -08:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
safexcel.c crypto: safexcel - Cleanup ring IRQ workqueues on load failure 2023-03-14 17:06:44 +08:00
safexcel.h crypto: safexcel - Use crypto_wait_req 2023-02-10 17:20:19 +08:00
safexcel_cipher.c crypto: safexcel - Add error handling for dma_map_sg() calls 2024-01-25 15:35:16 -08:00
safexcel_hash.c crypto: safexcel - Use crypto_wait_req 2023-02-10 17:20:19 +08:00
safexcel_ring.c crypto: inside-secure - Prevent missing of processing errors 2020-09-18 17:20:10 +10:00