diff options
author | Aaron Ma <aaron.ma@canonical.com> | 2020-04-03 22:34:19 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-10 10:30:10 +0200 |
commit | 74edc32fda52b684a9af99dd65aa7745a170a18d (patch) | |
tree | bf382a219d74cf1226ebe45cfe160f614ade73b0 | |
parent | 9d0dc9fb94a564075403116591c728aedbe656d8 (diff) | |
download | linux-stable-74edc32fda52b684a9af99dd65aa7745a170a18d.tar.gz linux-stable-74edc32fda52b684a9af99dd65aa7745a170a18d.tar.bz2 linux-stable-74edc32fda52b684a9af99dd65aa7745a170a18d.zip |
drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
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 <aaron.ma@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index c3df75a9f65d..e63a253eb425 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c @@ -71,7 +71,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); } |