Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer
@ 2026-07-13 10:16 Florian Fuchs
  2026-07-18 19:33 ` Helge Deller
  2026-07-18 21:57 ` Uwe Kleine-König
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Fuchs @ 2026-07-13 10:16 UTC (permalink / raw)
  To: Helge Deller, John Paul Adrian Glaubitz
  Cc: Uwe Kleine-König, linux-fbdev, dri-devel, linux-kernel,
	Florian Fuchs, kernel test robot

Add __user annotation to buf, as it is passed as a user pointer in
pin_user_pages_fast(). Use an empty initializer for the sentinel
board-table entry to avoid initializing a function pointer with an
integer literal.

Fixes: 5f566c0ac51c ("fbdev: pvr2fb: Fix leftover reference to ONCHIP_NR_DMA_CHANNELS")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202607131247.fpQ6eTc7-lkp@intel.com/
Signed-off-by: Florian Fuchs <fuchsfl@gmail.com>
---
Not sure, if we do such changes, but as I received a test robot email, I
leave it up to you all :) (I also compiled and tested the change)

 drivers/video/fbdev/pvr2fb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c
index 9428716e2dc4..a6e7abca7a06 100644
--- a/drivers/video/fbdev/pvr2fb.c
+++ b/drivers/video/fbdev/pvr2fb.c
@@ -639,7 +639,7 @@ static irqreturn_t __maybe_unused pvr2fb_interrupt(int irq, void *dev_id)
 }
 
 #ifdef CONFIG_PVR2_DMA
-static ssize_t pvr2fb_write(struct fb_info *info, const char *buf,
+static ssize_t pvr2fb_write(struct fb_info *info, const char __user *buf,
 			    size_t count, loff_t *ppos)
 {
 	unsigned long dst, start, end, len;
@@ -1077,7 +1077,7 @@ static struct pvr2_board {
 #ifdef CONFIG_PCI
 	{ pvr2fb_pci_init, pvr2fb_pci_exit, "PCI PVR2" },
 #endif
-	{ 0, },
+	{ },
 };
 
 static int __init pvr2fb_init(void)
-- 
2.43.0


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

* Re: [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer
  2026-07-13 10:16 [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer Florian Fuchs
@ 2026-07-18 19:33 ` Helge Deller
  2026-07-18 21:57 ` Uwe Kleine-König
  1 sibling, 0 replies; 3+ messages in thread
From: Helge Deller @ 2026-07-18 19:33 UTC (permalink / raw)
  To: Florian Fuchs, John Paul Adrian Glaubitz
  Cc: Uwe Kleine-König, linux-fbdev, dri-devel, linux-kernel,
	kernel test robot

On 7/13/26 12:16, Florian Fuchs wrote:
> Add __user annotation to buf, as it is passed as a user pointer in
> pin_user_pages_fast(). Use an empty initializer for the sentinel
> board-table entry to avoid initializing a function pointer with an
> integer literal.
> 
> Fixes: 5f566c0ac51c ("fbdev: pvr2fb: Fix leftover reference to ONCHIP_NR_DMA_CHANNELS")

I think this Fixes tag is wrong.
The problem has been there forever.

> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202607131247.fpQ6eTc7-lkp@intel.com/
> Signed-off-by: Florian Fuchs <fuchsfl@gmail.com>
> ---
> Not sure, if we do such changes, but as I received a test robot email, I
> leave it up to you all :) (I also compiled and tested the change)
> 
>   drivers/video/fbdev/pvr2fb.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
Patch applied to fbdev git tree.

Thanks for fixing!
Helge

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

* Re: [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer
  2026-07-13 10:16 [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer Florian Fuchs
  2026-07-18 19:33 ` Helge Deller
@ 2026-07-18 21:57 ` Uwe Kleine-König
  1 sibling, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2026-07-18 21:57 UTC (permalink / raw)
  To: Florian Fuchs
  Cc: Helge Deller, John Paul Adrian Glaubitz, linux-fbdev, dri-devel,
	linux-kernel, kernel test robot

[-- Attachment #1: Type: text/plain, Size: 652 bytes --]

On Mon, Jul 13, 2026 at 12:16:38PM +0200, Florian Fuchs wrote:
> Add __user annotation to buf, as it is passed as a user pointer in
> pin_user_pages_fast(). Use an empty initializer for the sentinel
> board-table entry to avoid initializing a function pointer with an
> integer literal.

FTR: Using 0 in an initializer is covered by the C standard. Anyhow, I
agree that { } is nicer.

Having said that, I think the right thing to do here is to drop the
sentinel entry, because board_driver[] is only used in for loops that
iterate between 0 (inclusive) and ARRAY_SIZE(board_driver) (exclusive).

Also I would split this patch in two.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2026-07-18 21:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 10:16 [PATCH] fbdev: pvr2fb: correct user pointer annotation and sentinel initializer Florian Fuchs
2026-07-18 19:33 ` Helge Deller
2026-07-18 21:57 ` Uwe Kleine-König

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