]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Fix memory leak in amdxdna_iommu_alloc()
authorFelix Gu <ustc.gu@gmail.com>
Thu, 16 Apr 2026 13:37:23 +0000 (21:37 +0800)
committerLizhi Hou <lizhi.hou@amd.com>
Thu, 16 Apr 2026 15:54:07 +0000 (08:54 -0700)
commit432fafdc9a3122a7bee5b2bfd23dcf2dc262a3d7
tree003ded0dfcf37965bb2685c79d6de9af8ba48ca0
parent6771275b4c96942b1b22ddcc9216e8458d206540
accel/amdxdna: Fix memory leak in amdxdna_iommu_alloc()

In amdxdna_iommu_alloc(), if iommu_map() fails after successfully
allocating both iova and cpu_addr, the code jumps to free_iova
which only frees the iova, leaking the allocated pages.

Fixes: ece3e8980907 ("accel/amdxdna: Allow forcing IOVA-based DMA via module parameter")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260416-amdxdna-v1-1-30c13008365c@gmail.com
drivers/accel/amdxdna/amdxdna_iommu.c