drm/amdgpu: Fix null pointer dereference
authorHawking Zhang <Hawking.Zhang@amd.com>
Mon, 22 Jan 2024 09:38:23 +0000 (17:38 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 25 Jan 2024 20:45:11 +0000 (15:45 -0500)
commitbc8f6d42b1334f486980d57c8d12f3128d30c2e3
tree9fa0d4f57db03935ce2452b11b74b6272cab69db
parent89a7c0bd74918f723c94c10452265e25063cba9b
drm/amdgpu: Fix null pointer dereference

amdgpu_reg_state_sysfs_fini could be invoked at the
time when asic_func is even not initialized, i.e.,
amdgpu_discovery_init fails for some reason.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/include/amdgpu_reg_state.h