public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [patch] drm/i915: unlock on error in i915_ppgtt_info()
@ 2015-10-02 15:14 Dan Carpenter
  2015-10-02 15:29 ` Geliang Tang
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-10-02 15:14 UTC (permalink / raw)
  To: Daniel Vetter, Geliang Tang
  Cc: Jani Nikula, David Airlie, intel-gfx, dri-devel, kernel-janitors

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

Fixes: 7cb5dff8d59d ('drm/i915: fix task reference leak in i915_debugfs.c')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index afa7982..dcc50f3 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2294,18 +2294,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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-05  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-02 15:14 [patch] drm/i915: unlock on error in i915_ppgtt_info() Dan Carpenter
2015-10-02 15:29 ` Geliang Tang
2015-10-05  8:01   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox