Commit 1197366c authored by Jinzhou Su's avatar Jinzhou Su Committed by Alex Deucher
Browse files

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: default avatarJinzhou Su <jinzhou.su@amd.com>
Reviewed-by: default avatarYang Wang <kevinyang.wang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e698127e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);