linux/drivers/gpu/drm/amd
Mario Limonciello 062ea905ff drm/amd: Fix NULL pointer dereference in device cleanup
When GPU initialization fails due to an unsupported HW block
IP blocks may have a NULL version pointer. During cleanup in
amdgpu_device_fini_hw, the code calls amdgpu_device_set_pg_state and
amdgpu_device_set_cg_state which iterate over all IP blocks and access
adev->ip_blocks[i].version without NULL checks, leading to a kernel
NULL pointer dereference.

Add NULL checks for adev->ip_blocks[i].version in both
amdgpu_device_set_cg_state and amdgpu_device_set_pg_state to prevent
dereferencing NULL pointers during GPU teardown when initialization has
failed.

Fixes: 39fc2bc4da ("drm/amdgpu: Protect GPU register accesses in powergated state in some paths")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b7ac77468c)
Cc: stable@vger.kernel.org
2026-03-06 17:10:40 -05:00
..
acp
amdgpu drm/amd: Fix NULL pointer dereference in device cleanup 2026-03-06 17:10:40 -05:00
amdkfd Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
amdxcp drm/amd/amdgpu: Release xcp drm memory after unplug 2025-08-04 14:35:48 -04:00
display drm/amd/display: Fallback to boot snapshot for dispclk 2026-03-02 17:13:52 -05:00
include drm/amdgpu/psp: Use Indirect access address for GFX to PSP mailbox 2026-03-04 13:15:00 -05:00
pm drm/amd/pm: add missing od setting PP_OD_FEATURE_ZERO_FAN_BIT for smu v14 2026-03-06 17:10:26 -05:00
ras Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00