drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Sun, 14 Jun 2020 07:12:29 +0000 (02:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:22:25 +0000 (11:22 +0200)
commit59e0b73b5d90955ab24c0d56e6561d7485b10295
tree1c52f768756e9e47cb472bede3c4eb073bad41a2
parenta0f19b6175ddeb13f85b7a82c46c5a07c15a2b37
drm/amdgpu: fix ref count leak in amdgpu_driver_open_kms

[ Upstream commit 9ba8923cbbe11564dd1bf9f3602add9a9cfbb5c6 ]

in amdgpu_driver_open_kms 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_kms.c