Merge tag 'kbuild-v5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-microblaze.git] / kernel / trace / trace_events_filter.c
index 217ef48..05a6649 100644 (file)
@@ -491,10 +491,12 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
                                break;
                        case '&':
                        case '|':
+                               /* accepting only "&&" or "||" */
                                if (next[1] == next[0]) {
                                        ptr++;
                                        break;
                                }
+                               /* fall through */
                        default:
                                parse_error(pe, FILT_ERR_TOO_MANY_PREDS,
                                            next - str);
@@ -823,6 +825,9 @@ enum regex_type filter_parse_regex(char *buff, int len, char **search, int *not)
 
        *search = buff;
 
+       if (isdigit(buff[0]))
+               return MATCH_INDEX;
+
        for (i = 0; i < len; i++) {
                if (buff[i] == '*') {
                        if (!i) {
@@ -860,6 +865,8 @@ static void filter_build_regex(struct filter_pred *pred)
        }
 
        switch (type) {
+       /* MATCH_INDEX should not happen, but if it does, match full */
+       case MATCH_INDEX:
        case MATCH_FULL:
                r->match = regex_match_full;
                break;