[PATCH v1 3/5] perf cpumap: Update CPU map merging test

Leo Yan posted 5 patches 2 months ago
[PATCH v1 3/5] perf cpumap: Update CPU map merging test
Posted by Leo Yan 2 months ago
Since the semantics of perf_cpu_map__merge() have changed, the two
arguments will not been released automatically in the function.

Update the test to release all CPU maps.

Signed-off-by: Leo Yan <leo.yan@arm.com>
---
 tools/perf/tests/cpumap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/tests/cpumap.c b/tools/perf/tests/cpumap.c
index 2f0168b2a5a9..ed07ef6d7e33 100644
--- a/tools/perf/tests/cpumap.c
+++ b/tools/perf/tests/cpumap.c
@@ -166,6 +166,7 @@ static int test__cpu_map_merge(struct test_suite *test __maybe_unused, int subte
 	TEST_ASSERT_VAL("failed to merge map: bad nr", perf_cpu_map__nr(c) == 5);
 	cpu_map__snprint(c, buf, sizeof(buf));
 	TEST_ASSERT_VAL("failed to merge map: bad result", !strcmp(buf, "1-2,4-5,7"));
+	perf_cpu_map__put(a);
 	perf_cpu_map__put(b);
 	perf_cpu_map__put(c);
 	return 0;
-- 
2.34.1