[5.9,037/152] drm/amd/amdgpu: fix null pointer in runtime pm
diff mbox series

Message ID 20201201084716.744009594@linuxfoundation.org
State New, archived
Headers show
Series
  • Untitled series #474541
Related show

Commit Message

Greg KH Dec. 1, 2020, 8:52 a.m. UTC
From: Kenneth Feng <kenneth.feng@amd.com>

commit 7acc79eb5f78d3d1aa5dd21fc0a0329f1b7f2be5 upstream.

fix the null pointer issue when runtime pm is triggered.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox series

--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -4593,7 +4593,7 @@  int amdgpu_device_baco_enter(struct drm_
 	if (!amdgpu_device_supports_baco(adev->ddev))
 		return -ENOTSUPP;
 
-	if (ras && ras->supported)
+	if (ras && ras->supported && adev->nbio.funcs->enable_doorbell_interrupt)
 		adev->nbio.funcs->enable_doorbell_interrupt(adev, false);
 
 	return amdgpu_dpm_baco_enter(adev);
@@ -4612,7 +4612,7 @@  int amdgpu_device_baco_exit(struct drm_d
 	if (ret)
 		return ret;
 
-	if (ras && ras->supported)
+	if (ras && ras->supported && adev->nbio.funcs->enable_doorbell_interrupt)
 		adev->nbio.funcs->enable_doorbell_interrupt(adev, true);
 
 	return 0;