Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH v3] fbdev: platinumfb: add error checking for ioremap calls
@ 2026-08-20  6:00 Yue Bing Kun
  2026-08-20 11:55 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Yue Bing Kun @ 2026-08-20  6:00 UTC (permalink / raw)
  To: Helge Deller; +Cc: Nathan Chancellor, linux-fbdev, dri-devel, linux-kernel

From: BingKun Yue <yuebingkun@kylinos.cn>

The ioremap() and ioremap_wt() calls in platinumfb_probe() were not
checked for failure. If any of these mappings fail, the driver would
dereference NULL pointers, leading to a kernel panic.

Add proper error checking and use goto-based cleanup to avoid code
duplication across the error paths.

Reported-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/linux-fbdev/20260819235918.GA2021182@ax162/
Signed-off-by: BingKun Yue <yuebingkun@kylinos.cn>
---
 drivers/video/fbdev/platinumfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c
index fdffadcc3e73..f74c937c839f 100644
--- a/drivers/video/fbdev/platinumfb.c
+++ b/drivers/video/fbdev/platinumfb.c
@@ -320,7 +320,7 @@ static void platinum_init_info(struct fb_info *info,
 	fb_alloc_cmap(&info->cmap, 256, 0);
 
 	/* Fill fix common fields */
-	strscpy(info->fix.id, "platinum", sizeof(info->fix.id));
+	strcpy(info->fix.id, "platinum");
 	info->fix.mmio_start = pinfo->platinum_regs_phys;
 	info->fix.mmio_len = 0x1000;
 	info->fix.type = FB_TYPE_PACKED_PIXELS;
-- 
2.43.0


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

* Re: [PATCH v3] fbdev: platinumfb: add error checking for ioremap calls
  2026-08-20  6:00 [PATCH v3] fbdev: platinumfb: add error checking for ioremap calls Yue Bing Kun
@ 2026-08-20 11:55 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2026-08-20 11:55 UTC (permalink / raw)
  To: Yue Bing Kun; +Cc: Nathan Chancellor, linux-fbdev, dri-devel, linux-kernel

On 8/20/26 08:00, Yue Bing Kun wrote:
> From: BingKun Yue <yuebingkun@kylinos.cn>

You are using various combinations of your name:
- BingKun Yue (as signed-off address)
- Yue Bing Kun (in plain email)
Maybe you should decide on one?

> The ioremap() and ioremap_wt() calls in platinumfb_probe() were not
> checked for failure. If any of these mappings fail, the driver would
> dereference NULL pointers, leading to a kernel panic.
> 
> Add proper error checking and use goto-based cleanup to avoid code
> duplication across the error paths.

This commit message has nothing to do with this patch.
  
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Link: https://lore.kernel.org/linux-fbdev/20260819235918.GA2021182@ax162/
> Signed-off-by: BingKun Yue <yuebingkun@kylinos.cn>
> ---
>   drivers/video/fbdev/platinumfb.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/fbdev/platinumfb.c b/drivers/video/fbdev/platinumfb.c
> index fdffadcc3e73..f74c937c839f 100644
> --- a/drivers/video/fbdev/platinumfb.c
> +++ b/drivers/video/fbdev/platinumfb.c
> @@ -320,7 +320,7 @@ static void platinum_init_info(struct fb_info *info,
>   	fb_alloc_cmap(&info->cmap, 256, 0);
>   
>   	/* Fill fix common fields */
> -	strscpy(info->fix.id, "platinum", sizeof(info->fix.id));
> +	strcpy(info->fix.id, "platinum");

And this one is a) reversed and b) useless & contraproductive (I will not take it).

Helge

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

end of thread, other threads:[~2026-08-20 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20  6:00 [PATCH v3] fbdev: platinumfb: add error checking for ioremap calls Yue Bing Kun
2026-08-20 11:55 ` Helge Deller

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