Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit 505ec05

Browse files
Yang Jihonggregkh
Yang Jihong
authored andcommitted
perf sched timehist: Fix missing free of session in perf_sched__timehist()
[ Upstream commit 6bdf516 ] When perf_time__parse_str() fails in perf_sched__timehist(), need to free session that was previously created, fix it. Fixes: 853b740 ("perf sched timehist: Add option to specify time window of interest") Signed-off-by: Yang Jihong <yangjihong@bytedance.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: David Ahern <dsa@cumulusnetworks.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: https://lore.kernel.org/r/20240806023533.1316348-1-yangjihong@bytedance.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 88c4b5d commit 505ec05

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/perf/builtin-sched.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -3068,7 +3068,8 @@ static int perf_sched__timehist(struct perf_sched *sched)
30683068

30693069
if (perf_time__parse_str(&sched->ptime, sched->time_str) != 0) {
30703070
pr_err("Invalid time string\n");
3071-
return -EINVAL;
3071+
err = -EINVAL;
3072+
goto out;
30723073
}
30733074

30743075
if (timehist_check_attr(sched, evlist) != 0)

0 commit comments

Comments
 (0)