From: Namhyung Kim <namhyung.kim@lge.com>
To: Steven Rostedt <rostedt@goodmis.org>
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: Tue, 24 Apr 2012 09:35:50 +0900 [thread overview]
Message-ID: <87ehrermop.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1335196274.28106.101.camel@gandalf.stny.rr.com> (Steven Rostedt's message of "Mon, 23 Apr 2012 11:51:14 -0400")
Hi,
On Mon, 23 Apr 2012 11:51:14 -0400, Steven Rostedt wrote:
> 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.
>
Agreed. I'm planning to dive into it soonish..
Thanks,
Namhyung
next prev parent reply other threads:[~2012-04-24 0:36 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
2012-04-24 0:35 ` Namhyung Kim [this message]
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=87ehrermop.fsf@sejong.aot.lge.com \
--to=namhyung.kim@lge.com \
--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=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