]> git.itanic.dy.fi Git - linux-stable/commitdiff
libbpf: Fix map index used in error message
authorToke Høiland-Jørgensen <toke@redhat.com>
Wed, 19 Aug 2020 11:05:34 +0000 (13:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:38 +0000 (11:29 +0200)
[ 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>
tools/lib/bpf/libbpf.c

index e0b88f0013b74e70314ce05287186381511694bf..3ac0094706b81bc11171d978ac36ad6c969acb32 100644 (file)
@@ -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;
        }