]> git.baikalelectronics.ru Git - kernel.git/commit
perf header: Fix lock/unlock imbalances when processing BPF/BTF info
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 8 Apr 2019 17:33:55 +0000 (12:33 -0500)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 16 Apr 2019 14:26:43 +0000 (11:26 -0300)
commitfcb1ce7f62e7670dd2c5aaf336cef4215c02462c
tree571d7821a18120fc9e5aeea715b1816b57ee508a
parent97da4dff43e2280d09f1e7d1ddea7e11e2a37cba
perf header: Fix lock/unlock imbalances when processing BPF/BTF info

Fix lock/unlock imbalances by refactoring the code a bit and adding
calls to up_write() before return.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Acked-by: Song Liu <songliubraving@fb.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Addresses-Coverity-ID: 1444315 ("Missing unlock")
Addresses-Coverity-ID: 1444316 ("Missing unlock")
Fixes: 1a7843d14f95 ("perf bpf: Save BTF information as headers to perf.data")
Fixes: b1d377ac981b ("perf bpf: Save bpf_prog_info information as headers to perf.data")
Link: http://lkml.kernel.org/r/20190408173355.GA10501@embeddedor
[ Simplified the exit path to have just one up_write() + return ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/header.c