OSDN Git Service

Merge tag 'trace-fixes-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt...
[uclinux-h8/linux.git] / kernel / trace / trace_events_filter.c
index 9d4a78f..1c92dfa 100644 (file)
@@ -1056,6 +1056,9 @@ static void parse_init(struct filter_parse_state *ps,
 
 static char infix_next(struct filter_parse_state *ps)
 {
+       if (!ps->infix.cnt)
+               return 0;
+
        ps->infix.cnt--;
 
        return ps->infix.string[ps->infix.tail++];
@@ -1071,6 +1074,9 @@ static char infix_peek(struct filter_parse_state *ps)
 
 static void infix_advance(struct filter_parse_state *ps)
 {
+       if (!ps->infix.cnt)
+               return;
+
        ps->infix.cnt--;
        ps->infix.tail++;
 }
@@ -1385,7 +1391,9 @@ static int check_preds(struct filter_parse_state *ps)
                if (elt->op != OP_NOT)
                        cnt--;
                n_normal_preds++;
-               WARN_ON_ONCE(cnt < 0);
+               /* all ops should have operands */
+               if (cnt < 0)
+                       break;
        }
 
        if (cnt != 1 || !n_normal_preds || n_logical_preds >= n_normal_preds) {