public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6.31 PATCH] tracing/filters: don't use pred on alloc failure
@ 2009-08-08 15:49 Tom Zanussi
  2009-08-08 16:03 ` [tip:tracing/core] tracing/filters: Don't " tip-bot for Tom Zanussi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Zanussi @ 2009-08-08 15:49 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Dan Carpenter, Steven Rostedt, Frederic Weisbecker, Li Zefan,
	LKML

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.

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>

The original report:

create_logical_pred() could sometimes return NULL.

It's a static checker complaining rather than problems at runtime...

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
 kernel/trace/trace_events_filter.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 936c621..1557148 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1029,6 +1029,8 @@ static int replace_preds(struct event_subsystem *system,
 
 		if (elt->op == OP_AND || elt->op == OP_OR) {
 			pred = create_logical_pred(elt->op);
+			if (!pred)
+				return -ENOMEM;
 			if (call) {
 				err = filter_add_pred(ps, call, pred);
 				filter_free_pred(pred);
@@ -1048,6 +1050,8 @@ static int replace_preds(struct event_subsystem *system,
 		}
 
 		pred = create_pred(elt->op, operand1, operand2);
+		if (!pred)
+			return -ENOMEM;
 		if (call) {
 			err = filter_add_pred(ps, call, pred);
 			filter_free_pred(pred);
-- 
1.5.6.3




^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [tip PATCH] tracing/filters: don't use pred on alloc failure
@ 2009-08-08 15:49 Tom Zanussi
  2009-08-08 16:04 ` [tip:tracing/core] tracing/filters: Don't " tip-bot for Tom Zanussi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Zanussi @ 2009-08-08 15:49 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Dan Carpenter, Steven Rostedt, Frederic Weisbecker, Li Zefan,
	LKML

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
tip.

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>

The original report:

create_logical_pred() could sometimes return NULL.

It's a static checker complaining rather than problems at runtime...
---
 kernel/trace/trace_events_filter.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 27c2dbe..490337a 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,
 
 		pred = create_pred(elt->op, operand1, operand2);
 add_pred:
+		if (!pred)
+			return -ENOMEM;
 		if (call)
 			err = filter_add_pred(ps, call, pred, false);
 		else
-- 
1.5.6.3




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-08 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-08 15:49 [2.6.31 PATCH] tracing/filters: don't use pred on alloc failure Tom Zanussi
2009-08-08 16:03 ` [tip:tracing/core] tracing/filters: Don't " tip-bot for Tom Zanussi
  -- strict thread matches above, loose matches on Subject: below --
2009-08-08 15:49 [tip PATCH] tracing/filters: don't " Tom Zanussi
2009-08-08 16:04 ` [tip:tracing/core] tracing/filters: Don't " tip-bot for Tom Zanussi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox