[PATCH v2 16/26] perf symbol-elf: Correct holding a reference

Ian Rogers irogers at google.com
Thu Jun 8 16:28:13 PDT 2023


If a reference is held, don't put it as this will confuse reference
count checking.

Signed-off-by: Ian Rogers <irogers at google.com>
---
 tools/perf/util/symbol-elf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 63882a4db5c7..e6493d1cc251 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -1389,11 +1389,11 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map,
 			/* Ensure maps are correctly ordered */
 			if (kmaps) {
 				int err;
+				struct map *tmp = map__get(map);
 
-				map__get(map);
 				maps__remove(kmaps, map);
 				err = maps__insert(kmaps, map);
-				map__put(map);
+				map__put(tmp);
 				if (err)
 					return err;
 			}
-- 
2.41.0.162.gfafddb0af9-goog




More information about the linux-arm-kernel mailing list