Skip to content

Commit 288f6b8

Browse files
committed
perf test: Fix leak in "Synthesize attr update" test
JIRA: https://issues.redhat.com/browse/RHEL-78197 upstream ======== commit 2c744f3 Author: Ian Rogers <irogers@google.com> Date: Wed Mar 5 11:19:31 2025 -0800 description =========== The own_cpus map variable may be non-NULL and hold a reference, in particular on hybrid machines. Do a put before overwriting the variable to avoid a memory leak. Signed-off-by: Ian Rogers <irogers@google.com> Reviewed-by: James Clark <james.clark@linaro.org> Link: https://lore.kernel.org/r/20250305191931.604764-1-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Michael Petlan <mpetlan@redhat.com>
1 parent 46a1b18 commit 288f6b8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/perf/tests/event_update.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ static int test__event_update(struct test_suite *test __maybe_unused, int subtes
109109
TEST_ASSERT_VAL("failed to synthesize attr update name",
110110
!perf_event__synthesize_event_update_name(&tmp.tool, evsel, process_event_name));
111111

112+
perf_cpu_map__put(evsel->core.own_cpus);
112113
evsel->core.own_cpus = perf_cpu_map__new("1,2,3");
113114

114115
TEST_ASSERT_VAL("failed to synthesize attr update cpus",

0 commit comments

Comments
 (0)