summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_debugfs.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-10-02 18:14:22 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-10-05 10:01:02 +0200
commit068127601eefa0565f4b2f4d82750cad9e37000c (patch)
tree94cef4c5ba2c090857eccee11a8528d58c4c4428 /drivers/gpu/drm/i915/i915_debugfs.c
parent022e4e52a750066047b22031733df70e136ae299 (diff)
downloadlwn-068127601eefa0565f4b2f4d82750cad9e37000c.tar.gz
lwn-068127601eefa0565f4b2f4d82750cad9e37000c.zip
drm/i915: unlock on error in i915_ppgtt_info()
We need to call intel_runtime_pm_put() and mutex_unlock() before returning. Fixes: 7cb5dff8d59d ('drm/i915: fix task reference leak in i915_debugfs.c') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_debugfs.c')
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 77ee8c5062b9..7e65015ecbee 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2298,18 +2298,21 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
struct task_struct *task;
task = get_pid_task(file->pid, PIDTYPE_PID);
- if (!task)
- return -ESRCH;
+ if (!task) {
+ ret = -ESRCH;
+ goto out_put;
+ }
seq_printf(m, "\nproc: %s\n", task->comm);
put_task_struct(task);
idr_for_each(&file_priv->context_idr, per_file_ctx,
(void *)(unsigned long)m);
}
+out_put:
intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev->struct_mutex);
- return 0;
+ return ret;
}
static int count_irq_waiters(struct drm_i915_private *i915)