drm/amdgpu: correct the amdgpu runtime dereference usage count
authorPrike Liang <Prike.Liang@amd.com>
Wed, 8 Nov 2023 06:38:29 +0000 (14:38 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Nov 2023 23:04:55 +0000 (18:04 -0500)
Fix the amdgpu runpm dereference usage count.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

index 0cacd0b9f8bead80defff6463e2c32a436305c68..b8fbe97efe1d3cc2c24f1e2ac10eeaa1d3c63563 100644 (file)
@@ -340,14 +340,11 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
                adev->have_disp_power_ref = true;
                return ret;
        }
-       /* if we have no active crtcs, then drop the power ref
-        * we got before
+       /* if we have no active crtcs, then go to
+        * drop the power ref we got before
         */
-       if (!active && adev->have_disp_power_ref) {
-               pm_runtime_put_autosuspend(dev->dev);
+       if (!active && adev->have_disp_power_ref)
                adev->have_disp_power_ref = false;
-       }
-
 out:
        /* drop the power reference we got coming in here */
        pm_runtime_put_autosuspend(dev->dev);