Files
linux/drivers/gpu/drm/amd/amdgpu
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
..
2024-07-24 17:30:23 -04:00
2026-01-20 17:25:53 -05:00
2025-10-13 14:14:15 -04:00
2024-11-03 01:28:06 -05:00
2024-01-15 18:35:37 -05:00
2024-01-15 18:35:37 -05:00
2026-01-05 16:59:55 -05:00
2024-07-24 17:30:23 -04:00
2024-07-24 17:30:23 -04:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2023-08-07 16:35:38 -04:00
2026-01-08 11:41:34 -05:00
2026-01-05 16:59:55 -05:00
2023-08-30 15:00:27 -04:00
2025-12-08 13:56:42 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-02-12 15:23:39 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2026-01-05 16:59:55 -05:00
2025-12-08 13:56:42 -05:00
2023-08-31 16:34:05 -04:00