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:19:23 +0000 (11:19 +0200)
commit28e269f9e6ac6dd13fc8342994130d2d90c77ee6
tree4d081d2a66c94cc043e8c537b720a5fdea1a5e61
parent9b1e3b74c4e35eaaa2fc41c9bb805405c9390fa7
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