Skip to content

Commit

Permalink
drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
Browse files Browse the repository at this point in the history
commit 5932d260a8d85a103bd6c504fbb85ff58b156bf9 upstream.

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]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
pyma1 authored and wulf7 committed Aug 14, 2021
1 parent e43fb9c commit 93009ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
adev->pm.ac_power = true;
else
adev->pm.ac_power = false;
if (adev->powerplay.pp_funcs->enable_bapm)
if (adev->powerplay.pp_funcs &&
adev->powerplay.pp_funcs->enable_bapm)
amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power);
mutex_unlock(&adev->pm.mutex);
}
Expand Down

0 comments on commit 93009ba

Please sign in to comment.