]> Git Repo - linux.git/commitdiff
drm/amd/amdgpu: fix null pointer in runtime pm
authorKenneth Feng <[email protected]>
Tue, 17 Nov 2020 13:10:59 +0000 (21:10 +0800)
committerAlex Deucher <[email protected]>
Tue, 24 Nov 2020 17:27:01 +0000 (12:27 -0500)
fix the null pointer issue when runtime pm is triggered.

Signed-off-by: Kenneth Feng <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Cc: [email protected]
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index e3783f5a459d555050a0ec5b41a3ecc3b2d75186..026789b466db9a83aed5be61f1e018a8edf7f9c4 100644 (file)
@@ -4852,7 +4852,7 @@ int amdgpu_device_baco_enter(struct drm_device *dev)
        if (!amdgpu_device_supports_baco(adev_to_drm(adev)))
                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);
@@ -4871,7 +4871,7 @@ int amdgpu_device_baco_exit(struct drm_device *dev)
        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;
This page took 0.066873 seconds and 4 git commands to generate.