drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sun, 14 Jun 2020 07:05:28 +0000 (02:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:22:26 +0000 (11:22 +0200)
commitc7aa94be6daf4c83a4ad57b08b0f6c977247d9a0
tree2bf48e1ccff2ca308d073a69ed8439d9cbdfe914
parent5f8cf9e55e75a705356e8ecb1efc56158a4b0898
drm/amdgpu/display: fix ref count leak when pm_runtime_get_sync fails

[ Upstream commit f79f94765f8c39db0b7dec1d335ab046aac03f20 ]

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_connectors.c