mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Namhyung Kim <namhyung.kim@lge.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Arnaldo Carvalho de Melo <acme@infradead.org>,
	Borislav Petkov <bp@alien8.de>, David Ahern <dsahern@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/7] parse-events: Handle strdup failure cases
Date: Mon, 23 Apr 2012 11:51:14 -0400	[thread overview]
Message-ID: <1335196274.28106.101.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <1333940074-19052-5-git-send-email-namhyung.kim@lge.com>

On Mon, 2012-04-09 at 11:54 +0900, Namhyung Kim wrote:
> There were some places didn't check return value of the strdup
> and had unneeded/duplicated checks. Fix it.
> 
> Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
> ---
>  parse-events.c |   29 +++++++++++++++++++++++++++--
>  1 files changed, 27 insertions(+), 2 deletions(-)
> 
> diff --git a/parse-events.c b/parse-events.c
> index 0b1e40a..773c928 100644
> --- a/parse-events.c
> +++ b/parse-events.c
> @@ -463,8 +463,10 @@ int pevent_register_function(struct pevent *pevent, char *func,
>  		item->mod = NULL;
>  	item->addr = addr;
>  
> -	pevent->funclist = item;
> +	if (!item->func || (mod && !item->mod))
> +		die("malloc func");
>  

I just added this patch, but we need to get rid of all the "die"
functions and do proper freeing and error notifications to make this a
real library.

Thanks,

-- Steve



  reply	other threads:[~2012-04-23 15:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09  2:54 [PATCH 0/7] trace-cmd: Small fixes and cleanups on libparsevent Namhyung Kim
2012-04-09  2:54 ` [PATCH 1/7] trace-cmd: Add NO_PYTHON option for Makefile Namhyung Kim
2012-04-10 17:36   ` Steven Rostedt
2012-04-09  2:54 ` [PATCH 2/7] parse-events: Fix printk_cmp() Namhyung Kim
2012-04-10 17:36   ` Steven Rostedt
2012-07-06 11:12   ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09  2:54 ` [PATCH 3/7] parse-events: Introduce extend_token() Namhyung Kim
2012-07-06 11:13   ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09  2:54 ` [PATCH 4/7] parse-events: Handle strdup failure cases Namhyung Kim
2012-04-23 15:51   ` Steven Rostedt [this message]
2012-04-24  0:35     ` Namhyung Kim
2012-04-24  0:41       ` Steven Rostedt
2012-07-06 11:14   ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09  2:54 ` [PATCH 5/7] parse-events: Fix a possible memory leak Namhyung Kim
2012-04-09  2:54 ` [PATCH 6/7] parse-events: Handle realloc() failure path Namhyung Kim
2012-07-06 11:15   ` [tip:perf/core] tools lib traceevent: " tip-bot for Namhyung Kim
2012-04-09  2:54 ` [PATCH 7/7] parse-events: Fix a possibly wrong memory dereference Namhyung Kim
2012-04-09 17:22 ` [PATCH 0/7] trace-cmd: Small fixes and cleanups on libparsevent Frederic Weisbecker
2012-04-10  0:53   ` Namhyung Kim

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=1335196274.28106.101.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=acme@infradead.org \
    --cc=bp@alien8.de \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    /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

all inboxes | Powered by JetHome®