Skip to content

Commit

Permalink
drm/i915: unlock on error in i915_ppgtt_info()
Browse files Browse the repository at this point in the history
We need to call intel_runtime_pm_put() and mutex_unlock() before
returning.

Fixes: 7cb5dff ('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>
  • Loading branch information
Dan Carpenter authored and Daniel Vetter committed Oct 5, 2015
1 parent 022e4e5 commit 0681276
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0681276

Please sign in to comment.