Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf symbol-elf: Add missing puts on error path

In dso__process_kernel_symbol if inserting a map fails, probably
ENOMEM, then the reference count puts were missing on the dso and map.

Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
b3ea721b 830f1854

+4 -1
+4 -1
tools/perf/util/symbol-elf.c
··· 1447 1447 map__set_mapping_type(curr_map, MAPPING_TYPE__IDENTITY); 1448 1448 } 1449 1449 dso__set_symtab_type(curr_dso, dso__symtab_type(dso)); 1450 - if (maps__insert(kmaps, curr_map)) 1450 + if (maps__insert(kmaps, curr_map)) { 1451 + dso__put(curr_dso); 1452 + map__put(curr_map); 1451 1453 return -1; 1454 + } 1452 1455 dsos__add(&maps__machine(kmaps)->dsos, curr_dso); 1453 1456 dso__set_loaded(curr_dso); 1454 1457 dso__put(*curr_dsop);