From: Suraj Jitindar Singh <surajjs@amazon.com>
To: <stable@vger.kernel.org>
Cc: <gregkh@linuxfoundation.org>, <chenyichong@uniontech.com>,
<andrii@kernel.org>, <bpf@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 6.1.y] bpftool: remove duplicate free_btf_vmlinux() definition
Date: Wed, 16 Sep 2026 00:27:18 +0000 [thread overview]
Message-ID: <20260916002719.27379-1-surajjs@amazon.com> (raw)
In-Reply-To: <20260915235834.20559-1-surajjs@amazon.com>
v6.1.188 backported
660a19e46942 ("tools/bpf/bpftool: Reset vmlinux BTF after map commands")
[ upstream commit 66d7e39e49b0 ]
which re-adds free_btf_vmlinux(). However, the prerequisite cleanup
52df1a8aabad ("bpftool: remove function free_btf_vmlinux()")
was never backported to 6.1.y, so the tree still carried the original
free_btf_vmlinux() definition. The backport therefore produced two
identical-signature static definitions in tools/bpf/bpftool/map.c and
the build fails:
map.c: error: redefinition of 'free_btf_vmlinux'
Remove the stale pre-existing definition, keeping the one reintroduced
by 660a19e46942 (which also resets btf_vmlinux = NULL). This matches the
current mainline end state.
Fixes: 660a19e46942 ("tools/bpf/bpftool: Reset vmlinux BTF after map commands")
Signed-off-by: Suraj Jitindar Singh <surajjs@amazon.com>
---
This is a stable-only fix. Mainline is not affected: 52df1a8aabad
("bpftool: remove function free_btf_vmlinux()") removed the original
definition, and 66d7e39e49b0 later re-added a single one. The duplicate
exists only in the 5.15.y and 6.1.y trees, which received the backport
of 66d7e39e49b0 without the prerequisite 52df1a8aabad. There is
therefore no single upstream commit to cite; the fix restores the
mainline end state.
tools/bpf/bpftool/map.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index a77bf45d6f83..748b3def6b2c 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -817,11 +817,6 @@ static void free_map_kv_btf(struct btf *btf)
btf__free(btf);
}
-static void free_btf_vmlinux(void)
-{
- btf__free(btf_vmlinux);
-}
-
static int
map_dump(int fd, struct bpf_map_info *info, json_writer_t *wtr,
bool show_header)
--
2.47.3
next prev parent reply other threads:[~2026-09-16 0:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 23:58 [REGRESSION] 5.15.221 & 6.1.188: bpftool: redefinition of 'free_btf_vmlinux' Suraj Jitindar Singh
2026-09-16 0:27 ` Suraj Jitindar Singh [this message]
2026-09-16 0:27 ` [PATCH 5.15.y] bpftool: remove duplicate free_btf_vmlinux() definition Suraj Jitindar Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260916002719.27379-1-surajjs@amazon.com \
--to=surajjs@amazon.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chenyichong@uniontech.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®