]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
accel/amdxdna: Fix iommu_map_sgtable() return value handling
authorLizhi Hou <lizhi.hou@amd.com>
Mon, 13 Apr 2026 18:02:38 +0000 (11:02 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Tue, 14 Apr 2026 16:10:47 +0000 (09:10 -0700)
commit1bcfa4c4e88a554d1b6f98f4e3f886288581cbb4
treefee63212257732fb286dbe9848be87b31687f525
parentf604819d9cc9532f88bb4cbd76e7227532ce5abb
accel/amdxdna: Fix iommu_map_sgtable() return value handling

iommu_map_sgtable() returns negative error codes on failure, but the
result is stored in an unsigned variable. This prevents proper error
detection.

Change the variable type to ssize_t so negative error values can be
handled correctly.

Fixes: ece3e8980907 ("accel/amdxdna: Allow forcing IOVA-based DMA via module parameter")
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/all/adk7kOUBwIyYnX1M@stanley.mountain/
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Wendy Liang <wendy.liang@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260413180238.668441-1-lizhi.hou@amd.com
drivers/accel/amdxdna/amdxdna_iommu.c