tracing: Have error path in predicate_parse() free its allocated memory
[linux-2.6-block.git] / kernel / trace / trace_events_filter.c
index 5079d1db3754a0bc872f39c12905aa0192d7839c..c9a74f82b14a279c270268c43cad6287d691d438 100644 (file)
@@ -452,8 +452,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
 
                switch (*next) {
                case '(':                                       /* #2 */
-                       if (top - op_stack > nr_parens)
-                               return ERR_PTR(-EINVAL);
+                       if (top - op_stack > nr_parens) {
+                               ret = -EINVAL;
+                               goto out_free;
+                       }
                        *(++top) = invert;
                        continue;
                case '!':                                       /* #3 */
@@ -1084,6 +1086,9 @@ int filter_assign_type(const char *type)
        if (strchr(type, '[') && strstr(type, "char"))
                return FILTER_STATIC_STRING;
 
+       if (strcmp(type, "char *") == 0 || strcmp(type, "const char *") == 0)
+               return FILTER_PTR_STRING;
+
        return FILTER_OTHER;
 }