lkml.org 
[lkml]   [2009]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [2.6.31 PATCH] tracing/filters: always free pred on filter_add_subsystem_pred() failure

* Tom Zanussi <tzanussi@gmail.com> wrote:

> If filter_add_subsystem_pred() fails due to ENOSPC or ENOMEM, the
> pred doesn't get freed, while as a side effect it does for other
> errors. Make it so the caller always frees the pred for any error.

thanks, i've queued this up for .31.

Just to make sure: tracing/core has the filter code changed
substantially, and this issue seems to be moot there - correct?

So the total impact from both patches on -tip is the patch below -
right?

Ingo

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

\
 
 \ /
  Last update: 2009-08-08 18:05    [W:0.042 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site