[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <690406fd-306c-9786-bacc-fd27e2e531fb@huawei.com>
Date: Mon, 13 Dec 2021 08:47:53 +0000
From: John Garry <john.garry@...wei.com>
To: José Expósito <jose.exposito89@...il.com>,
<peterz@...radead.org>
CC: <mingo@...hat.com>, <acme@...nel.org>, <mark.rutland@....com>,
<alexander.shishkin@...ux.intel.com>, <jolsa@...hat.com>,
<namhyung@...nel.org>, <irogers@...gle.com>, <ak@...ux.intel.com>,
<linux-perf-users@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] perf util: Fix use after free in metric__new
On 12/12/2021 11:58, José Expósito wrote:
> Fixes: b85a4d61d302 (perf metric: Allow modifiers on metrics)
> Addresses-Coverity-ID: 1494000
> Acked-by: Ian Rogers <irogers@...gle.com>
> Signed-off-by: José Expósito <jose.exposito89@...il.com>
Reviewed-by: John Garry <john.garry@...wei.com>
>
> ---
>
> v2: Add Fixes and Acked-by tags
> ---
> tools/perf/util/metricgroup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
> index fffe02aae3ed..4d2fed3aefd1 100644
> --- a/tools/perf/util/metricgroup.c
> +++ b/tools/perf/util/metricgroup.c
> @@ -209,8 +209,8 @@ static struct metric *metric__new(const struct pmu_event *pe,
> m->metric_name = pe->metric_name;
> m->modifier = modifier ? strdup(modifier) : NULL;
> if (modifier && !m->modifier) {
> - free(m);
> expr__ctx_free(m->pctx);
> + free(m);
> return NULL;
> }
> m->metric_expr = pe->metric_expr;
>
Powered by blists - more mailing lists