drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sun, 14 Jun 2020 07:09:44 +0000 (02:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:17 +0000 (11:29 +0200)
commitb86657e328b601a5b98f8c4c21d108d356dbceee
tree152daa32f165e4140e18e307c3ec698ca18858dd
parentc04caca229c44ce250f90fd7a7da33eb64ac2a70
drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config

[ Upstream commit e008fa6fb41544b63973a529b704ef342f47cc65 ]

in amdgpu_display_crtc_set_config, the call to pm_runtime_get_sync
increments the counter even in case of failure, leading to incorrect
ref count. In case of failure, decrement the ref count before returning.

Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c