diff options
| author | Yang Jihong <[email protected]> | 2024-08-06 02:35:33 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2024-08-16 22:31:15 +0000 |
| commit | 6bdf5168b6fb19541b0c1862bdaa596d116c7bfb (patch) | |
| tree | 852473fdc086bbe79fd8f83941658b5266f7a06b /tools/perf/builtin-sched.c | |
| parent | tools build: Provide consistent build options for fixdep (diff) | |
| download | kernel-6bdf5168b6fb19541b0c1862bdaa596d116c7bfb.tar.gz kernel-6bdf5168b6fb19541b0c1862bdaa596d116c7bfb.zip | |
perf sched timehist: Fix missing free of session in perf_sched__timehist()
When perf_time__parse_str() fails in perf_sched__timehist(),
need to free session that was previously created, fix it.
Fixes: 853b74071110bed3 ("perf sched timehist: Add option to specify time window of interest")
Signed-off-by: Yang Jihong <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Ian Rogers <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/builtin-sched.c')
| -rw-r--r-- | tools/perf/builtin-sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c index 34fe8e540c43..9c1276dc8ef6 100644 --- a/tools/perf/builtin-sched.c +++ b/tools/perf/builtin-sched.c @@ -3120,7 +3120,8 @@ static int perf_sched__timehist(struct perf_sched *sched) if (perf_time__parse_str(&sched->ptime, sched->time_str) != 0) { pr_err("Invalid time string\n"); - return -EINVAL; + err = -EINVAL; + goto out; } if (timehist_check_attr(sched, evlist) != 0) |
