Skip to content

Commit

Permalink
tracing/filters: Don't use pred on alloc failure
Browse files Browse the repository at this point in the history
Dan Carpenter sent me a fix to prevent pred from being used if
it couldn't be allocated.  This updates his patch for the same
problem in the tracing tree (which has changed this code quite
substantially).

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <1249746576.6453.30.camel@tropicana>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
The original report:

create_logical_pred() could sometimes return NULL.

It's a static checker complaining rather than problems at runtime...
  • Loading branch information
zanussi authored and Ingo Molnar committed Aug 8, 2009
1 parent a2ca5e0 commit fb82ad7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,8 @@ static int replace_preds(struct event_subsystem *system,

pred = create_pred(elt->op, operand1, operand2);
add_pred:
if (!pred)
return -ENOMEM;
if (call)
err = filter_add_pred(ps, call, pred, false);
else
Expand Down

0 comments on commit fb82ad7

Please sign in to comment.