diff options
author | Geliang Tang <geliangtang@163.com> | 2015-09-25 06:58:11 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-09-25 08:26:37 -0400 |
commit | 7cb5dff8d59da8008c6ec30d4161e8e96aa4afe8 (patch) | |
tree | 550e4713810d01562aebc3408fe49aa18feaf234 /drivers/gpu/drm | |
parent | 7c4a7d60bcda9449bca1ed2ee47392cd7acb8535 (diff) |
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 1c60fef535d143860d5bf6593e24ab6417f5227c
Author: Ben Widawsky <ben@bwidawsk.net>
Date: Fri Dec 6 14:11:30 2013 -0800
drm/i915: Dump all ppgtt
Signed-off-by: Geliang Tang <geliangtang@163.com>
[danvet: Add note provided by Jani about which commit introduced this
issue.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 5615d3d3ab59..879771766973 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) | |||
2288 | 2288 | ||
2289 | list_for_each_entry_reverse(file, &dev->filelist, lhead) { | 2289 | list_for_each_entry_reverse(file, &dev->filelist, lhead) { |
2290 | struct drm_i915_file_private *file_priv = file->driver_priv; | 2290 | struct drm_i915_file_private *file_priv = file->driver_priv; |
2291 | struct task_struct *task; | ||
2291 | 2292 | ||
2292 | seq_printf(m, "\nproc: %s\n", | 2293 | task = get_pid_task(file->pid, PIDTYPE_PID); |
2293 | get_pid_task(file->pid, PIDTYPE_PID)->comm); | 2294 | if (!task) |
2295 | return -ESRCH; | ||
2296 | seq_printf(m, "\nproc: %s\n", task->comm); | ||
2297 | put_task_struct(task); | ||
2294 | idr_for_each(&file_priv->context_idr, per_file_ctx, | 2298 | idr_for_each(&file_priv->context_idr, per_file_ctx, |
2295 | (void *)(unsigned long)m); | 2299 | (void *)(unsigned long)m); |
2296 | } | 2300 | } |