]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
libbpf: Use pre-setup sec_def in libbpf_find_attach_btf_id()
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 16 Sep 2021 01:58:30 +0000 (18:58 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Sep 2021 16:04:12 +0000 (09:04 -0700)
commitf11f86a3931b5d533aed1be1720fbd55bd63174d
tree499439e013261aec23ca7690d766b29c3bd7e25a
parent336562752acc1a723f9a24b5b8129ae22e0478c6
libbpf: Use pre-setup sec_def in libbpf_find_attach_btf_id()

Don't perform another search for sec_def inside
libbpf_find_attach_btf_id(), as each recognized bpf_program already has
prog->sec_def set.

Also remove unnecessary NULL check for prog->sec_name, as it can never
be NULL.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210916015836.1248906-2-andrii@kernel.org
tools/lib/bpf/libbpf.c