diff options
| author | Alexei Starovoitov <[email protected]> | 2021-12-12 01:16:19 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2021-12-12 01:16:19 +0000 |
| commit | 259172bb6514758ce3be1610c500b51a9f44212a (patch) | |
| tree | 0aca5192af1b4508645315c2a3fc74d1f12bfba9 /tools/lib/bpf/libbpf_legacy.h | |
| parent | Merge branch 'add-fdma-support-on-ocelot-switch-driver' (diff) | |
| download | kernel-259172bb6514758ce3be1610c500b51a9f44212a.tar.gz kernel-259172bb6514758ce3be1610c500b51a9f44212a.zip | |
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: ba05fd36b851 ("libbpf: Perform map fd cleanup for gen_loader in case of error")
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/lib/bpf/libbpf_legacy.h')
0 files changed, 0 insertions, 0 deletions
