public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools lib traceevent: Replace malloc_or_die to plain malloc in alloc_event()
@ 2012-06-11  6:28 Namhyung Kim
  2012-06-13  5:48 ` Namhyung Kim
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Namhyung Kim @ 2012-06-11  6:28 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, LKML, Namhyung Kim,
	Frederic Weisbecker, Steven Rostedt

From: Namhyung Kim <namhyung.kim@lge.com>

Because the only caller of the alloc_event()
(pevent_parse_event) checks return value properly,
it can be changed to use plain malloc.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/lib/traceevent/event-parse.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index c471075e4974..a6b5bcdc5580 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -621,7 +621,9 @@ static struct event_format *alloc_event(void)
 {
 	struct event_format *event;
 
-	event = malloc_or_die(sizeof(*event));
+	event = malloc(sizeof(*event));
+	if (!event)
+		return NULL;
 	memset(event, 0, sizeof(*event));
 
 	return event;
-- 
1.7.10.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-06 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-11  6:28 [PATCH] tools lib traceevent: Replace malloc_or_die to plain malloc in alloc_event() Namhyung Kim
2012-06-13  5:48 ` Namhyung Kim
2012-06-15  3:30 ` Steven Rostedt
2012-06-15  8:45   ` Namhyung Kim
2012-06-28 16:24 ` Arnaldo Carvalho de Melo
2012-07-06 10:56 ` [tip:perf/core] " tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox