]> git.baikalelectronics.ru Git - kernel.git/commit
tools, bpftool: Add missing close before bpftool net attach exit
authorWang Hai <wanghai38@huawei.com>
Fri, 13 Nov 2020 11:51:52 +0000 (19:51 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 Nov 2020 14:59:13 +0000 (15:59 +0100)
commit3172831cac790a9095784c95ba7d700fcd32b13e
tree25b30c6cb94fa06e95c2e562f611eedfd9ae8544
parent00b2ae766ea8202151d6894571af4e010dc1e4a4
tools, bpftool: Add missing close before bpftool net attach exit

progfd is created by prog_parse_fd() in do_attach() and before the latter
returns in case of success, the file descriptor should be closed.

Fixes: d6e586b6744e ("tools: bpftool: add net attach command to attach XDP on interface")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20201113115152.53178-1-wanghai38@huawei.com
tools/bpf/bpftool/net.c