libbpf: Restore errno after pr_warn.
authorAlexei Starovoitov <ast@kernel.org>
Fri, 30 Dec 2022 03:12:17 +0000 (19:12 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 30 Dec 2022 03:18:08 +0000 (19:18 -0800)
commitbb5747cfbc4b7fe29621ca6cd4a695d2723bf2e8
treed5bc0780aa6ae6d11b1f172031fcd0753f0a13ba
parent678a1c036199011e65b203367900f002a28da004
libbpf: Restore errno after pr_warn.

pr_warn calls into user-provided callback, which can clobber errno, so
`errno = saved_errno` should happen after pr_warn.

Fixes: 07453245620c ("libbpf: fix errno is overwritten after being closed.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf_internal.h