Thread (9 messages) 9 messages, 6 authors, 2024-09-11

[PATCH] fbdev/xen-fbfront: Assign fb_info->device

flat view
STALE764d REVIEWED: 1 (0M)

From: Jason Andryuk <hidden>
Date: 2024-09-10 02:10:08
Also in: dri-devel, lkml, stable, xen-devel
Subsystem: framebuffer layer, the rest, xen hypervisor interface · Maintainers: Helge Deller, Linus Torvalds, Juergen Gross, Stefano Stabellini

1 review trailer.

From: Jason Andryuk <redacted>

Probing xen-fbfront faults in video_is_primary_device().  The passed-in
struct device is NULL since xen-fbfront doesn't assign it and the
memory is kzalloc()-ed.  Assign fb_info->device to avoid this.

This was exposed by the conversion of fb_is_primary_device() to
video_is_primary_device() which dropped a NULL check for struct device.

Fixes: f178e96de7f0 ("arch: Remove struct fb_info from video helpers")
Reported-by: Arthur Borsboom <redacted>
Closes: https://lore.kernel.org/xen-devel/CALUcmUncX=LkXWeiSiTKsDY-cOe8QksWhFvcCneOKfrKd0ZajA@mail.gmail.com/ (local)
Tested-by: Arthur Borsboom <redacted>
CC: stable@vger.kernel.org
Signed-off-by: Jason Andryuk <redacted>
---
The other option would be to re-instate the NULL check in
video_is_primary_device()
---
 drivers/video/fbdev/xen-fbfront.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/xen-fbfront.c b/drivers/video/fbdev/xen-fbfront.c
index 66d4628a96ae..c90f48ebb15e 100644
--- a/drivers/video/fbdev/xen-fbfront.c
+++ b/drivers/video/fbdev/xen-fbfront.c
@@ -407,6 +407,7 @@ static int xenfb_probe(struct xenbus_device *dev,
 	/* complete the abuse: */
 	fb_info->pseudo_palette = fb_info->par;
 	fb_info->par = info;
+	fb_info->device = &dev->dev;
 
 	fb_info->screen_buffer = info->fb;
 
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help