]> git.baikalelectronics.ru Git - kernel.git/commit
perf annotate: Fix multiple memory and file descriptor leaks
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 14 Oct 2019 17:10:47 +0000 (12:10 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 15 Oct 2019 15:00:01 +0000 (12:00 -0300)
commitec8af54b4e463d52c393241cf22e1e0f0e617758
treefd737ed747f9e1561d1690f5c14941a2144c380e
parent56c2bf88ca4184d52de40504d8d0d45faa7aaab2
perf annotate: Fix multiple memory and file descriptor leaks

Store SYMBOL_ANNOTATE_ERRNO__BPF_MISSING_BTF in variable *ret*, instead
of returning in the middle of the function and leaking multiple
resources: prog_linfo, btf, s and bfdf.

Addresses-Coverity-ID: 1454832 ("Structurally dead code")
Fixes: 56f74adc194a ("perf annotate: Don't return -1 for error when doing BPF disassembly")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20191014171047.GA30850@embeddedor
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c