diff options
author | Aditya Pakki <pakki001@umn.edu> | 2020-06-14 04:48:37 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2020-07-24 11:50:49 +0300 |
commit | 8f29432417b11039ef960ab18987c7d61b2b5396 (patch) | |
tree | 169963d8afdd979c385397f9635b58783642b5e6 /drivers/gpu/drm/nouveau/nouveau_debugfs.c | |
parent | 990a1162986e8eff7ca18cc5a0e03b4304392ae2 (diff) | |
download | linux-8f29432417b11039ef960ab18987c7d61b2b5396.tar.xz |
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/drm/nouveau/nouveau_debugfs.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_debugfs.c | 4 |
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)); |