Skip to content
Commit 259172bb authored by Alexei Starovoitov's avatar Alexei Starovoitov
Browse files

libbpf: Fix gen_loader assumption on number of programs.

libbpf's obj->nr_programs includes static and global functions. That number
could be higher than the actual number of bpf programs going be loaded by
gen_loader. Passing larger nr_programs to bpf_gen__init() doesn't hurt. Those
exra stack slots will stay as zero. bpf_gen__finish() needs to check that
actual number of progs that gen_loader saw is less than or equal to
obj->nr_programs.

Fixes: ba05fd36

 ("libbpf: Perform map fd cleanup for gen_loader in case of error")
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 77ab714f
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment