libbpf: Close fd in bpf_object__reuse_map
PATCH v2 1/1 libbpf: Close fd in bpf_object__reuse_map
pin_fd is dup-ed and assigned in bpf_map__reuse_fd. Close it in bpf_object__reuse_map after reuse.
Signed-off-by Hengqi Chen <[email protected]>
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -4800,8 +4800,8 @@ bpf_object__reuse_map(struct bpf_map *map) } err =bpf_map__reuse_fd (map, pin_fd); +close (pin_fd);if (err) { -close (pin_fd);return err; } map->pinned = true;
--
2.25.1
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Daniel Borkmann <[email protected]>:
Quoted 9 lines · On Sat, 19 Mar 2022 11:05:33 +0800 you wrote:
pin_fdis dup-ed and assigned inbpf_map__reuse_fd. Close it inbpf_object__reuse_mapafter reuse.Signed-off-by Hengqi Chen <[email protected]>--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)[...]
Here is the summary with links:
- [v2,bpf-next] libbpf: Close fd in bpf_object__reuse_map
https://git.kernel.org/bpf/bpf-next/c/d0f325c34c2f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html