From: Jules Irenge <jbi.octave@gmail.com>
To: ast@kernel.org
Cc: memxor@gmail.com, john.fastabend@gmail.com, andrii@kernel.org,
daniel@iogearbox.net, martin.lau@linux.dev, bpf@vger.kernel.org,
inux-kernel@vger.kernel.org, Elana.Copperman@mobileye.com,
jbi.octave@gmail.com
Subject: [PATCH bpf-next] Fixes: 14a324f6a67e ("bpf: Wire up freeing of referenced kptr")
Date: Sun, 4 Sep 2022 11:18:59 +0100 [thread overview]
Message-ID: <YxR7k0EH2JCxU5I2@playground> (raw)
This patch fixes a warning generated by Sparse
"warning: Using plain integer as NULL pointer"
by replacing p with *p in the WRITE_ONCE() macro
This enables the pointer to be cleared on map value delete,
hence clearing the warning.
Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
kernel/bpf/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 27760627370d..f798acd43a28 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -598,7 +598,7 @@ void bpf_map_free_kptrs(struct bpf_map *map, void *map_value)
if (off_desc->type == BPF_KPTR_UNREF) {
u64 *p = (u64 *)btf_id_ptr;
- WRITE_ONCE(p, 0);
+ WRITE_ONCE(*p, 0);
continue;
}
old_ptr = xchg(btf_id_ptr, 0);
--
2.35.1
next reply other threads:[~2022-09-04 10:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-04 10:18 Jules Irenge [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-09-04 10:28 [PATCH bpf-next] Fixes: 14a324f6a67e ("bpf: Wire up freeing of referenced kptr") Jules Irenge
2022-09-04 21:10 ` Kumar Kartikeya Dwivedi
2022-09-07 18:20 ` patchwork-bot+netdevbpf
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=YxR7k0EH2JCxU5I2@playground \
--to=jbi.octave@gmail.com \
--cc=Elana.Copperman@mobileye.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=inux-kernel@vger.kernel.org \
--cc=john.fastabend@gmail.com \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
/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