[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zr-F5gFbV1zSbO2M@google.com>
Date: Fri, 16 Aug 2024 10:01:26 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Yang Jihong <yangjihong@...edance.com>
Cc: peterz@...radead.org, mingo@...hat.com, acme@...nel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...nel.org, irogers@...gle.com, adrian.hunter@...el.com,
kan.liang@...ux.intel.com, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf sched timehist: Fix missing free of session in
perf_sched__timehist()
On Tue, Aug 06, 2024 at 10:35:33AM +0800, Yang Jihong wrote:
> When perf_time__parse_str() fails in perf_sched__timehist(),
> need to free session that was previously created, fix it.
>
> Fixes: 853b74071110 ("perf sched timehist: Add option to specify time window of interest")
> Signed-off-by: Yang Jihong <yangjihong@...edance.com>
Acked-by: Namhyung Kim <namhyung@...nel.org>
Thanks,
Namhyung
> ---
> tools/perf/builtin-sched.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
> index 8750b5f2d49b..928b9041535d 100644
> --- a/tools/perf/builtin-sched.c
> +++ b/tools/perf/builtin-sched.c
> @@ -3121,7 +3121,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)
> --
> 2.25.1
>
Powered by blists - more mailing lists