aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorTom Zanussi <tzanussi@gmail.com>2009-08-08 11:49:36 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-08 11:58:07 -0400
commitfb82ad719831db58e9baa4c67015aae3fe27e7e3 (patch)
tree61009acdbd934e75c8328d1af6314e10ade6ffaf /kernel
parenta2ca5e03b6a5a1d401062f0a7f78888cf9e5e3b0 (diff)
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. 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...
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events_filter.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 27c2dbea3710..490337abed75 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1050,6 +1050,8 @@ static int replace_preds(struct event_subsystem *system,
1050 1050
1051 pred = create_pred(elt->op, operand1, operand2); 1051 pred = create_pred(elt->op, operand1, operand2);
1052add_pred: 1052add_pred:
1053 if (!pred)
1054 return -ENOMEM;
1053 if (call) 1055 if (call)
1054 err = filter_add_pred(ps, call, pred, false); 1056 err = filter_add_pred(ps, call, pred, false);
1055 else 1057 else