struct filter_parse_state *ps,
char *filter_string)
{
+ struct event_filter *filter = system->filter;
struct ftrace_event_call *call;
- struct event_filter *filter;
- int err;
bool fail = true;
+ int err;
list_for_each_entry(call, &ftrace_events, list) {
if (fail) {
parse_error(ps, FILT_ERR_BAD_SUBSYS_FILTER, 0);
- return err;
+ return -EINVAL;
}
return 0;
}
if (!strcmp(strstrip(filter_string), "0")) {
filter_disable_preds(call);
remove_filter_string(call->filter);
- mutex_unlock(&event_mutex);
- return 0;
+ goto out_unlock;
}
err = -ENOMEM;
if (!strcmp(strstrip(filter_string), "0")) {
filter_free_subsystem_preds(system);
remove_filter_string(system->filter);
- mutex_unlock(&event_mutex);
- return 0;
+ goto out_unlock;
}
err = -ENOMEM;
if (call->id == event_id)
break;
}
+
+ err = -EINVAL;
if (!call)
- return -EINVAL;
+ goto out_unlock;
+ err = -EEXIST;
if (event->filter)
- return -EEXIST;
+ goto out_unlock;
filter = __alloc_preds();
- if (IS_ERR(filter))
- return PTR_ERR(filter);
+ if (IS_ERR(filter)) {
+ err = PTR_ERR(filter);
+ goto out_unlock;
+ }
err = -ENOMEM;
ps = kzalloc(sizeof(*ps), GFP_KERNEL);
if (err)
__free_preds(filter);
+out_unlock:
mutex_unlock(&event_mutex);
return err;