]> Git Repo - linux.git/commitdiff
tracing: Have error path in predicate_parse() free its allocated memory
authorNavid Emamdoost <[email protected]>
Fri, 20 Sep 2019 22:57:59 +0000 (17:57 -0500)
committerSteven Rostedt (VMware) <[email protected]>
Sat, 28 Sep 2019 21:13:39 +0000 (17:13 -0400)
In predicate_parse, there is an error path that is not going to
out_free instead it returns directly which leads to a memory leak.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Navid Emamdoost <[email protected]>
Signed-off-by: Steven Rostedt (VMware) <[email protected]>
kernel/trace/trace_events_filter.c

index c773b8fb270c51a99f259edb51fd1f55b7202517..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 */
This page took 0.059773 seconds and 4 git commands to generate.