Skip to content

Commit 93009ba

Browse files
pyma1wulf7
authored andcommitted
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>
1 parent e43fb9c commit 93009ba

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
@@ -92,7 +92,8 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
9292
adev->pm.ac_power = true;
9393
else
9494
adev->pm.ac_power = false;
95-
if (adev->powerplay.pp_funcs->enable_bapm)
95+
if (adev->powerplay.pp_funcs &&
96+
adev->powerplay.pp_funcs->enable_bapm)
9697
amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power);
9798
mutex_unlock(&adev->pm.mutex);
9899
}

0 commit comments

Comments
 (0)