projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1824d8e
)
libbpf: Close fd in bpf_object__reuse_map
author
Hengqi Chen
<hengqi.chen@gmail.com>
Sat, 19 Mar 2022 03:05:33 +0000
(11:05 +0800)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Mon, 21 Mar 2022 14:36:52 +0000
(15:36 +0100)
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 <hengqi.chen@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link:
https://lore.kernel.org/bpf/20220319030533.3132250-1-hengqi.chen@gmail.com
tools/lib/bpf/libbpf.c
patch
|
blob
|
history
diff --git
a/tools/lib/bpf/libbpf.c
b/tools/lib/bpf/libbpf.c
index
2efe943
..
809fe20
100644
(file)
--- a/
tools/lib/bpf/libbpf.c
+++ b/
tools/lib/bpf/libbpf.c
@@
-4823,8
+4823,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;