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:29:17 +0000 (11:29 +0200)
commite4fdcdb7837c14bf03a8fca2b2e7d3c4ff246d8c
tree2c9c3df40538e059549e163050756e8d50f220ab
parentb86657e328b601a5b98f8c4c21d108d356dbceee
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