Skip to content

Commit 5932d26

Browse files
pyma1alexdeucher
authored andcommitted
drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
On ARCTURUS and RENOIR, powerplay is not supported yet. When plug in or unplug power jack, ACPI event will issue. Then kernel NULL pointer BUG will be triggered. Check for NULL pointers before calling. Signed-off-by: Aaron Ma <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent b74fb88 commit 5932d26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
8989
adev->pm.ac_power = true;
9090
else
9191
adev->pm.ac_power = false;
92-
if (adev->powerplay.pp_funcs->enable_bapm)
92+
if (adev->powerplay.pp_funcs &&
93+
adev->powerplay.pp_funcs->enable_bapm)
9394
amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power);
9495
mutex_unlock(&adev->pm.mutex);
9596

0 commit comments

Comments
 (0)