public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] ring-buffer: Introduce ring-buffer remotes
@ 2026-04-10 10:16 Dan Carpenter
  2026-04-10 12:46 ` Vincent Donnefort
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-04-10 10:16 UTC (permalink / raw)
  To: Vincent Donnefort; +Cc: linux-trace-kernel

Hello Vincent Donnefort,

Commit 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes")
from Mar 9, 2026 (linux-next), leads to the following Smatch static
checker warning:

	kernel/trace/ring_buffer.c:2243 ring_buffer_desc_page()
	warn: array off by one? 'desc->page_va[page_id]'

kernel/trace/ring_buffer.c
    2241 static void *ring_buffer_desc_page(struct ring_buffer_desc *desc, int page_id)
    2242 {
--> 2243         return page_id > desc->nr_page_va ? NULL : (void *)desc->page_va[page_id];
                                ^
Based on the len = struct_size(desc, page_va, desc->nr_page_va), in
ring_buffer_desc(), I'm pretty sure this should be >= instead of >.

    2244 }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-10 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 10:16 [bug report] ring-buffer: Introduce ring-buffer remotes Dan Carpenter
2026-04-10 12:46 ` Vincent Donnefort

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox