Skip to content

Commit 1197366

Browse files
JinzhouSualexdeucher
authored andcommitted
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>
1 parent e698127 commit 1197366

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,9 @@ int amdgpu_smu_ras_send_msg(struct amdgpu_device *adev, enum smu_message_type ms
619619
struct smu_context *smu = adev->powerplay.pp_handle;
620620
int ret = -EOPNOTSUPP;
621621

622+
if (!smu)
623+
return ret;
624+
622625
if (smu->ppt_funcs && smu->ppt_funcs->ras_send_msg)
623626
ret = smu->ppt_funcs->ras_send_msg(smu, msg, param, read_arg);
624627

0 commit comments

Comments
 (0)