Skip to content

Commit 1e891e5

Browse files
tohojoborkmann
authored andcommitted
libbpf: Fix map index used in error message
The error message emitted by bpf_object__init_user_btf_maps() was using the wrong section ID. Signed-off-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Yonghong Song <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 00fa1d8 commit 1e891e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ static int bpf_object__init_user_btf_maps(struct bpf_object *obj, bool strict,
22642264
data = elf_getdata(scn, NULL);
22652265
if (!scn || !data) {
22662266
pr_warn("failed to get Elf_Data from map section %d (%s)\n",
2267-
obj->efile.maps_shndx, MAPS_ELF_SEC);
2267+
obj->efile.btf_maps_shndx, MAPS_ELF_SEC);
22682268
return -EINVAL;
22692269
}
22702270

0 commit comments

Comments
 (0)