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 <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
This commit is contained in:
Родитель
1824d8ea75
Коммит
d0f325c34c
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче