提交 7cb5dff8 编写于 作者: G Geliang Tang 提交者: Daniel Vetter

drm/i915: fix task reference leak in i915_debugfs.c

Leak a task reference in i915_ppgtt_info(), add put_task_struct()
to fix it.

Introduced by

commit 1c60fef5
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Fri Dec 6 14:11:30 2013 -0800

    drm/i915: Dump all ppgtt
Signed-off-by: NGeliang Tang <geliangtang@163.com>
[danvet: Add note provided by Jani about which commit introduced this
issue.]
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 7c4a7d60
...@@ -2288,9 +2288,13 @@ static int i915_ppgtt_info(struct seq_file *m, void *data) ...@@ -2288,9 +2288,13 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
list_for_each_entry_reverse(file, &dev->filelist, lhead) { list_for_each_entry_reverse(file, &dev->filelist, lhead) {
struct drm_i915_file_private *file_priv = file->driver_priv; struct drm_i915_file_private *file_priv = file->driver_priv;
struct task_struct *task;
seq_printf(m, "\nproc: %s\n", task = get_pid_task(file->pid, PIDTYPE_PID);
get_pid_task(file->pid, PIDTYPE_PID)->comm); if (!task)
return -ESRCH;
seq_printf(m, "\nproc: %s\n", task->comm);
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);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册