Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <toke@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200819110534.9058-1-toke@redhat.com

authored by

Toke Høiland-Jørgensen and committed by
Daniel Borkmann
1e891e51 00fa1d83

+1 -1
+1 -1
tools/lib/bpf/libbpf.c
··· 2264 2264 data = elf_getdata(scn, NULL); 2265 2265 if (!scn || !data) { 2266 2266 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); 2268 2268 return -EINVAL; 2269 2269 } 2270 2270