aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2020-09-28 11:10:37 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-07 08:01:25 +0200
commit3d54a640e20cd4a48648ff7be3d859b4635a00fd (patch)
tree0021e263d733db857f669b5d37e5661ff623c52f
parentmemstick: Skip allocating card when removing host (diff)
downloadwireguard-linux-3d54a640e20cd4a48648ff7be3d859b4635a00fd.tar.xz
wireguard-linux-3d54a640e20cd4a48648ff7be3d859b4635a00fd.zip
drm/amdgpu: restore proper ref count in amdgpu_display_crtc_set_config
commit a39d0d7bdf8c21ac7645c02e9676b5cb2b804c31 upstream. A recent attempt to fix a ref count leak in amdgpu_display_crtc_set_config() turned out to be doing too much and "fixed" an intended decrease as if it were a leak. Undo that part to restore the proper balance. This is the very nature of this function to increase or decrease the power reference count depending on the situation. Consequences of this bug is that the power reference would eventually get down to 0 while the display was still in use, resulting in that display switching off unexpectedly. Signed-off-by: Jean Delvare <jdelvare@suse.de> Fixes: e008fa6fb415 ("drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config") Cc: stable@vger.kernel.org Cc: Navid Emamdoost <navid.emamdoost@gmail.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_display.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index e0aed42d9cbd..b588e0e409e7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -297,7 +297,7 @@ int amdgpu_display_crtc_set_config(struct drm_mode_set *set,
take the current one */
if (active && !adev->have_disp_power_ref) {
adev->have_disp_power_ref = true;
- goto out;
+ return ret;
}
/* if we have no active crtcs, then drop the power ref
we got before */