public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] tracing/ftrace: add missing unlock in register_stat_tracer()
Date: Thu, 15 Jan 2009 09:30:52 +0800	[thread overview]
Message-ID: <496E91CC.4020209@cn.fujitsu.com> (raw)

We should unlock all_stat_sessions_mutex before returning failure.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---

I noticed Ingo tend to delete the impact line from my changelog
if it added nothing new to the title, so no impact line for this
patch. :)

---
 kernel/trace/trace_stat.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_stat.c b/kernel/trace/trace_stat.c
index cb29282..8669f3c 100644
--- a/kernel/trace/trace_stat.c
+++ b/kernel/trace/trace_stat.c
@@ -73,8 +73,10 @@ int register_stat_tracer(struct tracer_stat *trace)
 	/* Already registered? */
 	mutex_lock(&all_stat_sessions_mutex);
 	list_for_each_entry_safe(node, tmp, &all_stat_sessions, session_list) {
-		if (node->ts == trace)
+		if (node->ts == trace) {
+			mutex_unlock(all_stat_sessions_mutex);
 			return -EINVAL;
+		}
 	}
 	mutex_unlock(&all_stat_sessions_mutex);
 
-- 
1.5.4.rc3

             reply	other threads:[~2009-01-15  1:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15  1:30 Li Zefan [this message]
2009-01-15  1:52 ` [PATCH] tracing/ftrace: add missing unlock in register_stat_tracer() Steven Rostedt
2009-01-15 10:32 ` Frédéric Weisbecker
  -- strict thread matches above, loose matches on Subject: below --
2009-01-15  1:57 Steven Rostedt
2009-01-15 10:02 ` Ingo Molnar
2009-01-15 10:14   ` Steven Rostedt
2009-01-15 10:25 ` Steven Rostedt
2009-01-15 10:26   ` Steven Rostedt
2009-01-15 10:28   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=496E91CC.4020209@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox