Skip to content

Commit 484d7dc

Browse files
Yu Songpingalexdeucher
authored andcommitted
swsmu/amdgpu_smu: Fix the wrong if-condition
The logical operator '&&' will make smu->ppt_funcs->set_gfx_power_up_by_imu segment fault when smu->ppt_funcs is NULL. Signed-off-by: Yu Songping <[email protected]> Reviewed-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5a2a19b commit 484d7dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ int smu_get_dpm_freq_range(struct smu_context *smu,
161161

162162
int smu_set_gfx_power_up_by_imu(struct smu_context *smu)
163163
{
164-
if (!smu->ppt_funcs && !smu->ppt_funcs->set_gfx_power_up_by_imu)
164+
if (!smu->ppt_funcs || !smu->ppt_funcs->set_gfx_power_up_by_imu)
165165
return -EOPNOTSUPP;
166166

167167
return smu->ppt_funcs->set_gfx_power_up_by_imu(smu);

0 commit comments

Comments
 (0)