drm/amdgpu: correct the amdgpu runtime dereference usage count
authorjsg <jsg@openbsd.org>
Thu, 14 Dec 2023 05:19:03 +0000 (05:19 +0000)
committerjsg <jsg@openbsd.org>
Thu, 14 Dec 2023 05:19:03 +0000 (05:19 +0000)
From Prike Liang
458affed061935948d31f5d731bbcfbff3158762 in linux-6.1.y/6.1.68
c6df7f313794c3ad41a49b9a7c95da369db607f3 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_display.c

index 7e98b12..231cb39 100644 (file)
@@ -304,14 +304,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);