aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAditya Pakki <pakki001@umn.edu>2020-06-13 20:48:37 -0500
committerBen Skeggs <bskeggs@redhat.com>2020-07-24 18:50:49 +1000
commit8f29432417b11039ef960ab18987c7d61b2b5396 (patch)
tree169963d8afdd979c385397f9635b58783642b5e6 /drivers/gpu
parentdrm/nouveau: Fix reference count leak in nouveau_connector_detect (diff)
downloadlinux-dev-8f29432417b11039ef960ab18987c7d61b2b5396.tar.xz
linux-dev-8f29432417b11039ef960ab18987c7d61b2b5396.zip
drm/nouveau: fix reference count leak in nouveau_debugfs_strap_peek
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_debugfs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 63b5c8cf9ae4..8f63cda3db17 100644
--- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
+++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
@@ -54,8 +54,10 @@ nouveau_debugfs_strap_peek(struct seq_file *m, void *data)
int ret;
ret = pm_runtime_get_sync(drm->dev->dev);
- if (ret < 0 && ret != -EACCES)
+ if (ret < 0 && ret != -EACCES) {
+ pm_runtime_put_autosuspend(drm->dev->dev);
return ret;
+ }
seq_printf(m, "0x%08x\n",
nvif_rd32(&drm->client.device.object, 0x101000));