Skip to content

Commit

Permalink
tools lib traceevent: Do not call add_event() again if allocation failed
Browse files Browse the repository at this point in the history
When memory allocation for the field name is failed, do not goto
event_failed since we added the event already.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Ahern <dsahern@gmail.com>
Link: http://lkml.kernel.org/r/1335157118-14658-8-git-send-email-namhyung.kim@lge.com
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
  • Loading branch information
Namhyung Kim authored and Namhyung Kim committed Jul 4, 2012
1 parent 3831a42 commit 4b5632b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -4770,7 +4770,8 @@ int pevent_parse_event(struct pevent *pevent,
arg->field.name = strdup(field->name);
if (!arg->field.name) {
do_warning("failed to allocate field name");
goto event_failed;
event->flags |= EVENT_FL_FAILED;
return -1;
}
arg->field.field = field;
}
Expand Down

0 comments on commit 4b5632b

Please sign in to comment.