[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.0903171847170.10610@gandalf.stny.rr.com>
Date: Tue, 17 Mar 2009 18:49:26 -0400 (EDT)
From: Steven Rostedt <rostedt@...dmis.org>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
cc: Ingo Molnar <mingo@...e.hu>, paulus@...ba.org,
LKML <linux-kernel@...r.kernel.org>,
Tom Zanussi <tzanussi@...il.com>
Subject: Re: [RFC][PATCH 03/11] ftrace: fix memory leak
Tom Zanussi beat you to it ;-)
http://marc.info/?l=linux-kernel&m=123727898221734&w=2
-- Steve
On Tue, 17 Mar 2009, Peter Zijlstra wrote:
> Don't return after an allocation without freeing -- fix it by moving the check
> up a few lines.
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> ---
> kernel/trace/trace_events.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> Index: linux-2.6/kernel/trace/trace_events.c
> ===================================================================
> --- linux-2.6.orig/kernel/trace/trace_events.c
> +++ linux-2.6/kernel/trace/trace_events.c
> @@ -380,15 +380,15 @@ event_format_read(struct file *filp, cha
> char *buf;
> int r;
>
> + if (*ppos)
> + return 0;
> +
> s = kmalloc(sizeof(*s), GFP_KERNEL);
> if (!s)
> return -ENOMEM;
>
> trace_seq_init(s);
>
> - if (*ppos)
> - return 0;
> -
> /* If any of the first writes fail, so will the show_format. */
>
> trace_seq_printf(s, "name: %s\n", call->name);
>
> --
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists