Skip to content

Commit 96c5c6e

Browse files
Navidemrostedt
authored andcommitted
tracing: Have error path in predicate_parse() free its allocated memory
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]>
1 parent 968e517 commit 96c5c6e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/trace/trace_events_filter.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,10 @@ predicate_parse(const char *str, int nr_parens, int nr_preds,
452452

453453
switch (*next) {
454454
case '(': /* #2 */
455-
if (top - op_stack > nr_parens)
456-
return ERR_PTR(-EINVAL);
455+
if (top - op_stack > nr_parens) {
456+
ret = -EINVAL;
457+
goto out_free;
458+
}
457459
*(++top) = invert;
458460
continue;
459461
case '!': /* #3 */

0 commit comments

Comments
 (0)