Skip to content

Commit 9df659a

Browse files
chenhengqiNobody
authored and
Nobody
committed
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]>
1 parent 2303fff commit 9df659a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4823,8 +4823,8 @@ bpf_object__reuse_map(struct bpf_map *map)
48234823
}
48244824

48254825
err = bpf_map__reuse_fd(map, pin_fd);
4826+
close(pin_fd);
48264827
if (err) {
4827-
close(pin_fd);
48284828
return err;
48294829
}
48304830
map->pinned = true;

0 commit comments

Comments
 (0)