From: Clark Williams <clrkwllms@kernel.org>
To: stable@vger.kernel.org
Cc: sashal@kernel.org, gregkh@linuxfoundation.org
Subject: [PATCH linux-6.1.y 1/2] tools/lib/bpf: fix const-qualifier discard in resolve_full_path
Date: Mon, 15 Jun 2026 20:33:05 -0500 [thread overview]
Message-ID: <20260616013306.3850069-2-clrkwllms@kernel.org> (raw)
In-Reply-To: <20260616013306.3850069-1-clrkwllms@kernel.org>
From: Clark Williams <clark.williams@gmail.com>
strchr() now propagates const when passed a const char * argument in
newer GCC/glibc combinations, causing -Werror=discarded-qualifiers to
fire on the assignment to next_path. Declare next_path as const char *
since it is only used for pointer arithmetic, never written through.
Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Clark Williams <clrkwllms@kernel.org>
---
tools/lib/bpf/libbpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 7bd6aff6e260..33b214a91338 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -10748,7 +10748,7 @@ static int resolve_full_path(const char *file, char *result, size_t result_sz)
if (!search_paths[i])
continue;
for (s = search_paths[i]; s != NULL; s = strchr(s, ':')) {
- char *next_path;
+ const char *next_path;
int seg_len;
if (s[0] == ':')
--
2.54.0
next prev parent reply other threads:[~2026-06-16 1:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 1:33 [PATCH linux-6.1.y 0/2] Clark Williams
2026-06-16 1:33 ` Clark Williams [this message]
2026-06-16 1:33 ` [PATCH linux-6.1.y 2/2] kvm/vmx: guard regparm(0) on vmread_error_trampoline for x86_32 only Clark Williams
2026-06-16 10:19 ` [PATCH linux-6.1.y 0/2] Greg KH
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=20260616013306.3850069-2-clrkwllms@kernel.org \
--to=clrkwllms@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=sashal@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.