drm/nouveau: fix reference count leak in nouveau_debugfs_strap_peek
authorAditya Pakki <pakki001@umn.edu>
Sun, 14 Jun 2020 01:48:37 +0000 (20:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:37 +0000 (08:23 +0200)
commit06d5a05fd6e81eee826cf9a47b0f01ce55011629
treea5675dc29b78551500054139cb9bd1ecc71fa4c1
parentfc20f2ac67b0aa31254d5363f96ed85e4506731c
drm/nouveau: fix reference count leak in nouveau_debugfs_strap_peek

[ Upstream commit 8f29432417b11039ef960ab18987c7d61b2b5396 ]

nouveau_debugfs_strap_peek() calls pm_runtime_get_sync() that
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_debugfs.c