From: Likun Gao Date: Wed, 12 Jan 2022 07:38:24 +0000 (+0800) Subject: drm/amd/pm: fix NULL pointer issue of amdgpu_smu_stb_debug_fs_init X-Git-Tag: howlett/maple/20220722_2~460^2~3^2~350 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6f3c9dbb65be3d90eee1b90e270c4e62b15a91b3;p=users%2Fjedix%2Flinux-maple.git drm/amd/pm: fix NULL pointer issue of amdgpu_smu_stb_debug_fs_init Fix NULL pointer issue on amdgpu_smu_stb_debug_fs_init if SMU block not enabled. Signed-off-by: Likun Gao Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c index f1544755d8b4..904d516c040b 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c @@ -3031,7 +3031,7 @@ void amdgpu_smu_stb_debug_fs_init(struct amdgpu_device *adev) struct smu_context *smu = adev->powerplay.pp_handle; - if (!smu->stb_context.stb_buf_size) + if (!smu || (!smu->stb_context.stb_buf_size)) return; debugfs_create_file_size("amdgpu_smu_stb_dump",