]> git.baikalelectronics.ru Git - kernel.git/commit
tools: bpftool: remember to close the libbpf object after prog load
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 20 Jun 2018 18:42:46 +0000 (11:42 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 21 Jun 2018 21:07:13 +0000 (23:07 +0200)
commit9f149105d0304a2650854fc8c5eb3500b69dcffa
treef8f65c36f80791edb98c219fa98f24c904d28741
parent58f1e50853958f4f11618806b48cc63be081e956
tools: bpftool: remember to close the libbpf object after prog load

Remembering to close all descriptors and free memory may not seem
important in a user space tool like bpftool, but if we were to run
in batch mode the consumed resources start to add up quickly.  Make
sure program load closes the libbpf object (which unloads and frees
it).

Fixes: 7424c14fffe7 ("bpftool: implement prog load command")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/bpf/bpftool/prog.c