drm/nouveau: fix multiple instances of reference count leaks
authorAditya Pakki <pakki001@umn.edu>
Sun, 14 Jun 2020 01:41:56 +0000 (20:41 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:37 +0000 (08:23 +0200)
commit8998c915db65cc3d1971cd243ca58eb1a39d9c69
tree51f7690a612e9674384286b367cc3a555a54ecf7
parent06d5a05fd6e81eee826cf9a47b0f01ce55011629
drm/nouveau: fix multiple instances of reference count leaks

[ Upstream commit 659fb5f154c3434c90a34586f3b7aa1c39cf6062 ]

On calling pm_runtime_get_sync() the reference count of the device
is incremented. 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_drm.c
drivers/gpu/drm/nouveau/nouveau_gem.c