aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_events.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_events.c')
-rw-r--r--kernel/trace/trace_events.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 789e14eb09a5..ead68ac99191 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -481,7 +481,7 @@ event_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
481 481
482 trace_seq_init(s); 482 trace_seq_init(s);
483 483
484 filter_print_preds(call->preds, s); 484 filter_print_preds(call->preds, call->n_preds, s);
485 r = simple_read_from_buffer(ubuf, cnt, ppos, s->buffer, s->len); 485 r = simple_read_from_buffer(ubuf, cnt, ppos, s->buffer, s->len);
486 486
487 kfree(s); 487 kfree(s);
@@ -516,7 +516,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
516 } 516 }
517 517
518 if (pred->clear) { 518 if (pred->clear) {
519 filter_free_preds(call); 519 filter_disable_preds(call);
520 filter_free_pred(pred); 520 filter_free_pred(pred);
521 return cnt; 521 return cnt;
522 } 522 }
@@ -527,6 +527,8 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
527 return err; 527 return err;
528 } 528 }
529 529
530 filter_free_pred(pred);
531
530 *ppos += cnt; 532 *ppos += cnt;
531 533
532 return cnt; 534 return cnt;
@@ -549,7 +551,7 @@ subsystem_filter_read(struct file *filp, char __user *ubuf, size_t cnt,
549 551
550 trace_seq_init(s); 552 trace_seq_init(s);
551 553
552 filter_print_preds(system->preds, s); 554 filter_print_preds(system->preds, system->n_preds, s);
553 r = simple_read_from_buffer(ubuf, cnt, ppos, s->buffer, s->len); 555 r = simple_read_from_buffer(ubuf, cnt, ppos, s->buffer, s->len);
554 556
555 kfree(s); 557 kfree(s);
@@ -712,6 +714,7 @@ event_subsystem_dir(const char *name, struct dentry *d_events)
712 list_add(&system->list, &event_subsystems); 714 list_add(&system->list, &event_subsystems);
713 715
714 system->preds = NULL; 716 system->preds = NULL;
717 system->n_preds = 0;
715 718
716 entry = debugfs_create_file("filter", 0644, system->entry, system, 719 entry = debugfs_create_file("filter", 0644, system->entry, system,
717 &ftrace_subsystem_filter_fops); 720 &ftrace_subsystem_filter_fops);