Commit 96b2de31 authored by Tom Zanussi's avatar Tom Zanussi Committed by Ingo Molnar

tracing/filters: Don't use pred on alloc failure

Dan Carpenter sent me a fix to prevent pred from being used if
it couldn't be allocated.  I noticed the same problem also
existed for the create_pred() case and added a fix for that.
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarTom 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: <1249746549.6453.29.camel@tropicana>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent bd3f0221
...@@ -1029,6 +1029,8 @@ static int replace_preds(struct event_subsystem *system, ...@@ -1029,6 +1029,8 @@ static int replace_preds(struct event_subsystem *system,
if (elt->op == OP_AND || elt->op == OP_OR) { if (elt->op == OP_AND || elt->op == OP_OR) {
pred = create_logical_pred(elt->op); pred = create_logical_pred(elt->op);
if (!pred)
return -ENOMEM;
if (call) { if (call) {
err = filter_add_pred(ps, call, pred); err = filter_add_pred(ps, call, pred);
filter_free_pred(pred); filter_free_pred(pred);
...@@ -1048,6 +1050,8 @@ static int replace_preds(struct event_subsystem *system, ...@@ -1048,6 +1050,8 @@ static int replace_preds(struct event_subsystem *system,
} }
pred = create_pred(elt->op, operand1, operand2); pred = create_pred(elt->op, operand1, operand2);
if (!pred)
return -ENOMEM;
if (call) { if (call) {
err = filter_add_pred(ps, call, pred); err = filter_add_pred(ps, call, pred);
filter_free_pred(pred); filter_free_pred(pred);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment