]> git.baikalelectronics.ru Git - kernel.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)
commite6051d4fdfaeaf5d98c89de3eb3547e448d63f72
tree499439e013261aec23ca7690d766b29c3bd7e25a
parent0a8b19aec9e61468fe5835c5d8fb93fc34da5e9e
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