libbpf: Clean gen_loader's attach kind.
authorAlexei Starovoitov <ast@kernel.org>
Wed, 1 Dec 2021 18:10:34 +0000 (10:10 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 10:03:24 +0000 (11:03 +0100)
commitdb3c2121d191ab82d68d54c02f6e90aeac33226f
tree3b3dcf2ac6ea598bbab70feb012da380b6f4471b
parente833ef0b545e1a5b3eaf00af391c4fd1fb47ffd8
libbpf: Clean gen_loader's attach kind.

[ Upstream commit 19250f5fc0c283892a61f3abf9d65e6325f63897 ]

The gen_loader has to clear attach_kind otherwise the programs
without attach_btf_id will fail load if they follow programs
with attach_btf_id.

Fixes: 67234743736a ("libbpf: Generate loader program out of BPF ELF file.")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211201181040.23337-12-alexei.starovoitov@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/bpf/gen_loader.c