]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/amdxdna: Fix NULL pointer dereference of mgmt_chann
authorLizhi Hou <lizhi.hou@amd.com>
Thu, 26 Feb 2026 21:38:57 +0000 (13:38 -0800)
committerLizhi Hou <lizhi.hou@amd.com>
Mon, 2 Mar 2026 17:43:22 +0000 (09:43 -0800)
commit6270ee26e1edd862ea17e3eba148ca8fb2c99dc9
tree9de6f025be510c7a18a58ccf3170acba41b3bead
parent2e3649e237237258a08d75afef96648dd2b379f7
accel/amdxdna: Fix NULL pointer dereference of mgmt_chann

mgmt_chann may be set to NULL if the firmware returns an unexpected
error in aie2_send_mgmt_msg_wait(). This can later lead to a NULL
pointer dereference in aie2_hw_stop().

Fix this by introducing a dedicated helper to destroy mgmt_chann
and by adding proper NULL checks before accessing it.

Fixes: b87f920b9344 ("accel/amdxdna: Support hardware mailbox")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260226213857.3068474-1-lizhi.hou@amd.com
drivers/accel/amdxdna/aie2_message.c
drivers/accel/amdxdna/aie2_pci.c
drivers/accel/amdxdna/aie2_pci.h