lkml.org 
[lkml]   [2009]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] trace: events_filter, fix lock imbalances
Date
apply_event_filter and apply_subsystem_event_filter omits an unlock
on one fail path each. Fix that.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
---
kernel/trace/trace_events_filter.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index 85ad6a8..e35094a 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -1080,8 +1080,10 @@ int apply_event_filter(struct ftrace_event_call *call, char *filter_string)
}

ps = kzalloc(sizeof(*ps), GFP_KERNEL);
- if (!ps)
- return -ENOMEM;
+ if (!ps) {
+ err = -ENOMEM;
+ goto unlock;
+ }

filter_disable_preds(call);
replace_filter_string(call->filter, filter_string);
@@ -1101,7 +1103,7 @@ out:
filter_opstack_clear(ps);
postfix_clear(ps);
kfree(ps);
-
+unlock:
mutex_unlock(&filter_mutex);

return err;
@@ -1124,8 +1126,10 @@ int apply_subsystem_event_filter(struct event_subsystem *system,
}

ps = kzalloc(sizeof(*ps), GFP_KERNEL);
- if (!ps)
- return -ENOMEM;
+ if (!ps) {
+ err = -ENOMEM;
+ goto unlock;
+ }

filter_free_subsystem_preds(system);
replace_filter_string(system->filter, filter_string);
@@ -1145,7 +1149,7 @@ out:
filter_opstack_clear(ps);
postfix_clear(ps);
kfree(ps);
-
+unlock:
mutex_unlock(&filter_mutex);

return err;
--
1.6.3


\
 
 \ /
  Last update: 2009-05-28 10:05    [W:0.044 / U:2.112 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site