提交 06812760 编写于 作者: D Dan Carpenter 提交者: Daniel Vetter

drm/i915: unlock on error in i915_ppgtt_info()

We need to call intel_runtime_pm_put() and mutex_unlock() before
returning.

Fixes: 7cb5dff8 ('drm/i915: fix task reference leak in i915_debugfs.c')
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Acked-by: NGeliang Tang <geliangtang@163.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 022e4e52
...@@ -2298,18 +2298,21 @@ static int i915_ppgtt_info(struct seq_file *m, void *data) ...@@ -2298,18 +2298,21 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
struct task_struct *task; struct task_struct *task;
task = get_pid_task(file->pid, PIDTYPE_PID); task = get_pid_task(file->pid, PIDTYPE_PID);
if (!task) if (!task) {
return -ESRCH; ret = -ESRCH;
goto out_put;
}
seq_printf(m, "\nproc: %s\n", task->comm); seq_printf(m, "\nproc: %s\n", task->comm);
put_task_struct(task); put_task_struct(task);
idr_for_each(&file_priv->context_idr, per_file_ctx, idr_for_each(&file_priv->context_idr, per_file_ctx,
(void *)(unsigned long)m); (void *)(unsigned long)m);
} }
out_put:
intel_runtime_pm_put(dev_priv); intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return 0; return ret;
} }
static int count_irq_waiters(struct drm_i915_private *i915) static int count_irq_waiters(struct drm_i915_private *i915)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册