Re: [PATCH] tracing/ftrace: add missing unlock inregister_stat_tracer()

From: Steven Rostedt
Date: Thu Jan 15 2009 - 05:25:49 EST



Ingo, revert this patch (or don't pull it yet)
I just noticed that it does not compile. I should not be doing git pulls
at night :-(


On Wed, 14 Jan 2009, Steven Rostedt wrote:

>
> Ingo,
>
> The following patch is in:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
>
> branch: tip/devel
>
>
> Li Zefan (1):
> tracing/ftrace: add missing unlock in register_stat_tracer()
>
> ----
> kernel/trace/trace_stat.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
> ---------------------------
> commit 6af81ac4701bf80dde4b723f28a777daefdf512c
> Author: Li Zefan <lizf@xxxxxxxxxxxxxx>
> Date: Thu Jan 15 09:30:52 2009 +0800
>
> tracing/ftrace: add missing unlock in register_stat_tracer()
>
> We should unlock all_stat_sessions_mutex before returning failure.
>
> Signed-off-by: Li Zefan <lizf@xxxxxxxxxxxxxx>
> Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
>
> 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);

missing &

-- Steve

> return -EINVAL;
> + }
> }
> mutex_unlock(&all_stat_sessions_mutex);
>
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/