summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinzhou Su <jinzhou.su@amd.com>2026-01-21 11:42:11 +0300
committerAlex Deucher <alexander.deucher@amd.com>2026-01-29 00:21:11 +0300
commit1197366cca89a4c44c541ddedb8ce8bf0757993d (patch)
tree2d69263e58dd3603d5f1a5c2ef9142755e583802
parente698127eb7249d6c70fa8f2bdba469c0e54f2e2b (diff)
downloadlinux-1197366cca89a4c44c541ddedb8ce8bf0757993d.tar.xz
drm/amd/pm: Fix null pointer dereference issue
If SMU is disabled, during RAS initialization, there will be null pointer dereference issue here. Signed-off-by: Jinzhou Su <jinzhou.su@amd.com> Reviewed-by: Yang Wang <kevinyang.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index 6b6b05e8f736..3f70731105a2 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -619,6 +619,9 @@ int amdgpu_smu_ras_send_msg(struct amdgpu_device *adev, enum smu_message_type ms
struct smu_context *smu = adev->powerplay.pp_handle;
int ret = -EOPNOTSUPP;
+ if (!smu)
+ return ret;
+
if (smu->ppt_funcs && smu->ppt_funcs->ras_send_msg)
ret = smu->ppt_funcs->ras_send_msg(smu, msg, param, read_arg);