summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/amd
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-05-11 05:11:24 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-05-11 05:11:24 +0000
commite20200c9fd37129beb8578aeed74bcdffdc34588 (patch)
tree4c5746b0c62192c695cf8e78c413cfcb58daea1f /sys/dev/pci/drm/amd
parent55989630e04ddc0bebcb6f661abbb95c39520f61 (diff)
drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
From Aaron Ma 74edc32fda52b684a9af99dd65aa7745a170a18d in linux 4.19.y/4.19.122 5932d260a8d85a103bd6c504fbb85ff58b156bf9 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/amd')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c
index b811ba056b0..53c1e1b0de2 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_pm.c
+++ b/sys/dev/pci/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);
}