[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <7789a9d65ac9f2fc27e95a40b6995b21aab9fb73.1443198651.git.geliangtang@163.com>
Date: Fri, 25 Sep 2015 03:58:11 -0700
From: Geliang Tang <geliangtang@....com>
To: Daniel Vetter <daniel.vetter@...el.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
David Airlie <airlied@...ux.ie>
Cc: Geliang Tang <geliangtang@....com>,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] 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.
Signed-off-by: Geliang Tang <geliangtang@....com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 5615d3d..8797717 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2288,9 +2288,13 @@ static int i915_ppgtt_info(struct seq_file *m, void *data)
list_for_each_entry_reverse(file, &dev->filelist, lhead) {
struct drm_i915_file_private *file_priv = file->driver_priv;
+ struct task_struct *task;
- seq_printf(m, "\nproc: %s\n",
- get_pid_task(file->pid, PIDTYPE_PID)->comm);
+ task = get_pid_task(file->pid, PIDTYPE_PID);
+ 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,
(void *)(unsigned long)m);
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists