aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@redhat.com>2020-08-19 13:05:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-03 11:29:38 +0200
commitd5a4d2f25d77133364a1a25d053818981e4bca44 (patch)
tree875994405d780e434fa3b8037396d219287613cf /tools
parent1c20c32e8a2a58909adb72aaf9c0be87c9ead0c4 (diff)
libbpf: Fix map index used in error message
[ Upstream commit 1e891e513e16c145cc9b45b1fdb8bf4a4f2f9557 ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/bpf/libbpf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index e0b88f0013b7..3ac0094706b8 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -2237,7 +2237,7 @@ static int bpf_object__init_user_btf_maps(struct bpf_object *obj, bool strict,
data = elf_getdata(scn, NULL);
if (!scn || !data) {
pr_warn("failed to get Elf_Data from map section %d (%s)\n",
- obj->efile.maps_shndx, MAPS_ELF_SEC);
+ obj->efile.btf_maps_shndx, MAPS_ELF_SEC);
return -EINVAL;
}