Merge tag 'trace-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux...
[sfrench/cifs-2.6.git] / kernel / trace / trace_events_filter.c
index 217ef481fbbb68261fab5468c63a5bba4faee099..05a66493a1640ff9f5ae0b72c409231d367104ec 100644 (file)
@@ -491,10 +491,12 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
                                break;
                        case '&':
                        case '|':
                                break;
                        case '&':
                        case '|':
+                               /* accepting only "&&" or "||" */
                                if (next[1] == next[0]) {
                                        ptr++;
                                        break;
                                }
                                if (next[1] == next[0]) {
                                        ptr++;
                                        break;
                                }
+                               /* fall through */
                        default:
                                parse_error(pe, FILT_ERR_TOO_MANY_PREDS,
                                            next - str);
                        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;
 
 
        *search = buff;
 
+       if (isdigit(buff[0]))
+               return MATCH_INDEX;
+
        for (i = 0; i < len; i++) {
                if (buff[i] == '*') {
                        if (!i) {
        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) {
        }
 
        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;
        case MATCH_FULL:
                r->match = regex_match_full;
                break;