kernel-fxtec-pro1x/tools/lib/bpf
Toke Høiland-Jørgensen b3051cd82d libbpf: Fix error handling in bpf_map__reuse_fd()
[ Upstream commit d1b4574a4b86565325ef2e545eda8dfc9aa07c60 ]

bpf_map__reuse_fd() was calling close() in the error path before returning
an error value based on errno. However, close can change errno, so that can
lead to potentially misleading error messages. Instead, explicitly store
errno in the err variable before each goto.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/157269297769.394725.12634985106772698611.stgit@toke.dk
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31 16:35:33 +01:00
..
.gitignore tools lib bpf: Change FEATURE-DUMP to FEATURE-DUMP.libbpf 2015-11-05 12:47:51 -03:00
bpf.c bpf: libbpf: retry loading program on EAGAIN 2019-10-01 08:26:08 +02:00
bpf.h libbpf: fix samples/bpf build failure due to undefined UINT32_MAX 2019-05-31 06:46:14 -07:00
btf.c Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-08-11 17:52:00 -07:00
btf.h Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net 2018-08-11 17:52:00 -07:00
Build tools lib bpf: Provide wrapper for strerror_r to build in !_GNU_SOURCE systems 2018-09-18 10:16:18 -03:00
libbpf.c libbpf: Fix error handling in bpf_map__reuse_fd() 2019-12-31 16:35:33 +01:00
libbpf.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2018-08-07 11:02:05 -07:00
libbpf_errno.c tools/bpf: make libbpf _GNU_SOURCE friendly 2019-12-13 08:52:15 +01:00
Makefile libbpf: force fixdep compilation at the start of the build 2019-04-05 22:32:57 +02:00
nlattr.c libbpf: add error reporting in XDP 2018-02-02 17:53:48 -08:00
nlattr.h libbpf: add error reporting in XDP 2018-02-02 17:53:48 -08:00
str_error.c tools lib bpf: Provide wrapper for strerror_r to build in !_GNU_SOURCE systems 2018-09-18 10:16:18 -03:00
str_error.h tools lib bpf: Provide wrapper for strerror_r to build in !_GNU_SOURCE systems 2018-09-18 10:16:18 -03:00