Skip to content

Commit

Permalink
parse-events: Let pevent_free() take a NULL pointer
Browse files Browse the repository at this point in the history
The pevent_free() should ack like other free()s and allow a
NULL pointer to be passed to it which makes error handling a bit
easier for the users of pevent_free().

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Arun Sharma <asharma@fb.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
  • Loading branch information
Steven Rostedt authored and Frederic Weisbecker committed Apr 25, 2012
1 parent 14ffde0 commit a2525a0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -4960,13 +4960,20 @@ static void free_event(struct event_format *event)
*/
void pevent_free(struct pevent *pevent)
{
struct cmdline_list *cmdlist = pevent->cmdlist, *cmdnext;
struct func_list *funclist = pevent->funclist, *funcnext;
struct printk_list *printklist = pevent->printklist, *printknext;
struct cmdline_list *cmdlist, *cmdnext;
struct func_list *funclist, *funcnext;
struct printk_list *printklist, *printknext;
struct pevent_function_handler *func_handler;
struct event_handler *handle;
int i;

if (!pevent)
return;

cmdlist = pevent->cmdlist;
funclist = pevent->funclist;
printklist = pevent->printklist;

pevent->ref_count--;
if (pevent->ref_count)
return;
Expand Down

0 comments on commit a2525a0

Please sign in to comment.