drm/nouveau: Fix reference count leak in nouveau_connector_detect
authorAditya Pakki <pakki001@umn.edu>
Sun, 14 Jun 2020 01:22:23 +0000 (20:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:21:17 +0000 (11:21 +0200)
commit2eac5a4ca1243e53aec275d745d950d376f5f2d7
tree44cc8e732ab2433181691653ad83b2faf8a7bec7
parentf4605dc3581fc71a5f065e1c0bb6e007fb439ac7
drm/nouveau: Fix reference count leak in nouveau_connector_detect

[ Upstream commit 990a1162986e8eff7ca18cc5a0e03b4304392ae2 ]

nouveau_connector_detect() calls pm_runtime_get_sync and in turn
increments the reference count. In case of failure, decrement the
ref count before returning the error.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/nouveau/nouveau_connector.c