Commit 2354075c authored by Prike Liang's avatar Prike Liang Committed by Baogen Shang
Browse files

drm/amdgpu: correct the amdgpu runtime dereference usage count

stable inclusion
from stable-v5.10.205
commit d4fb20dcc13b37ee4f02025cd1dc8054d6027721
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8AS5P
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.205&id=d4fb20dcc13b37ee4f02025cd1dc8054d6027721



-------------------------

[ Upstream commit c6df7f313794c3ad41a49b9a7c95da369db607f3 ]

Fix the amdgpu runpm dereference usage count.

Signed-off-by: default avatarPrike Liang <Prike.Liang@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarBaogen Shang <baogen.shang@windriver.com>
parent 4ab210f9
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -299,13 +299,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 (!active && adev->have_disp_power_ref) {
		pm_runtime_put_autosuspend(dev->dev);
	/* if we have no active crtcs, then go to
	 * drop the power ref we got before
	 */
	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);