]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Return ERR_PTR on dma_alloc_noncoherent failure
authorWendy Liang <wendy.liang@amd.com>
Mon, 23 Mar 2026 17:37:19 +0000 (10:37 -0700)
committerLizhi Hou <lizhi.hou@amd.com>
Mon, 23 Mar 2026 20:29:22 +0000 (13:29 -0700)
commit140cfee588af8656822b835ccd28515f0b8c77cf
treee600ba20fe14a7aedefb0f80866d494d8e66b303
parentd1c73884858cb3ce2a0f761988a6f279bff32b91
accel/amdxdna: Return ERR_PTR on dma_alloc_noncoherent failure

dma_alloc_noncoherent() returns NULL on failure, but callers of
aie2_alloc_msg_buffer() check for IS_ERR(). Return ERR_PTR(-ENOMEM)
instead of NULL to match the amdxdna_iommu_alloc() path and the
caller's error checking convention.

Fixes: ece3e8980907 ("accel/amdxdna: Allow forcing IOVA-based DMA via module parameter")
Signed-off-by: Wendy Liang <wendy.liang@amd.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260323173719.2311474-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_message.c