* [PATCH] perf: intel-tpebs: Fix incorrect usage of zfree()
@ 2025-03-19 10:16 James Clark
2025-03-20 16:00 ` Namhyung Kim
0 siblings, 1 reply; 2+ messages in thread
From: James Clark @ 2025-03-19 10:16 UTC (permalink / raw)
To: linux-perf-users
Cc: James Clark, Peter Zijlstra, Ingo Molnar,
Arnaldo Carvalho de Melo, Namhyung Kim, Mark Rutland,
Alexander Shishkin, Jiri Olsa, Ian Rogers, Adrian Hunter,
Liang, Kan, Weilin Wang, linux-kernel
zfree() requires an address otherwise it frees what's in name, rather
than name itself. Pass the address of name to fix it.
This was the only incorrect occurrence in Perf found using a search.
Fixes: 8db5cabcf1b6 ("perf stat: Fork and launch 'perf record' when 'perf stat' needs to get retire latency value for a metric.")
Signed-off-by: James Clark <james.clark@linaro.org>
---
tools/perf/util/intel-tpebs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/util/intel-tpebs.c b/tools/perf/util/intel-tpebs.c
index 50a3c3e07160..2c421b475b3b 100644
--- a/tools/perf/util/intel-tpebs.c
+++ b/tools/perf/util/intel-tpebs.c
@@ -254,7 +254,7 @@ int tpebs_start(struct evlist *evsel_list)
new = zalloc(sizeof(*new));
if (!new) {
ret = -1;
- zfree(name);
+ zfree(&name);
goto err;
}
new->name = name;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf: intel-tpebs: Fix incorrect usage of zfree()
2025-03-19 10:16 [PATCH] perf: intel-tpebs: Fix incorrect usage of zfree() James Clark
@ 2025-03-20 16:00 ` Namhyung Kim
0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2025-03-20 16:00 UTC (permalink / raw)
To: linux-perf-users, James Clark
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Ian Rogers,
Adrian Hunter, Liang, Kan, Weilin Wang, linux-kernel
On Wed, 19 Mar 2025 10:16:10 +0000, James Clark wrote:
> zfree() requires an address otherwise it frees what's in name, rather
> than name itself. Pass the address of name to fix it.
>
> This was the only incorrect occurrence in Perf found using a search.
>
>
Applied to perf-tools-next, thanks!
Best regards,
Namhyung
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-20 16:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-19 10:16 [PATCH] perf: intel-tpebs: Fix incorrect usage of zfree() James Clark
2025-03-20 16:00 ` Namhyung Kim
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).