Skip to contentSkip to conversation

fbdev: Set missing owner fields in fb_ops

PATCH In review Thomas Zimmermann 2 participants 5 messages Apr 24, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover fbdev: Set missing owner fields in fb_ops

Set the owner field of various drivers' fb_ops instance. The setting is required by fbcon, which acquires a reference on the fbdev driver's module. Otherwise, users could attempt to unload the module while it's still in use.

Thomas Zimmermann (3):
fbdev/68328fb: Init owner field of struct fb_ops fbdev/ps3fb: Init owner field of struct fb_ops fbdev/vfb: Init owner field of struct fb_ops

 drivers/video/fbdev/68328fb.c | 1 +
 drivers/video/fbdev/ps3fb.c   | 1 +
 drivers/video/fbdev/vfb.c     | 1 +
 3 files changed, 3 insertions(+)
Signature · 1 line
2.40.0
#1 lore raw

PATCH 1/3 fbdev/68328fb: Init owner field of struct fb_ops

Initialize the owner field of struct fb_ops. Required to prevent module unloading while the driver is in use.

---
 drivers/video/fbdev/68328fb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/fbdev/68328fb.c +1 -0
index ef49cdfb7dd2..07d6e8dc686b 100644
@@ -94,6 +94,7 @@ static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
 static int mc68x328fb_mmap(struct fb_info *info, struct vm_area_struct *vma);
 
 static const struct fb_ops mc68x328fb_ops = {
+	.owner		= THIS_MODULE,
 	.fb_check_var	= mc68x328fb_check_var,
 	.fb_set_par	= mc68x328fb_set_par,
 	.fb_setcolreg	= mc68x328fb_setcolreg,
Signature · 1 line
2.40.0
#2 lore raw

PATCH 2/3 fbdev/ps3fb: Init owner field of struct fb_ops

In reply to Thomas Zimmermann

Initialize the owner field of struct fb_ops. Required to prevent module unloading while the driver is in use.

---
 drivers/video/fbdev/ps3fb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/fbdev/ps3fb.c +1 -0
index 2fe08b67eda7..98aaa330a193 100644
@@ -936,6 +936,7 @@ static irqreturn_t ps3fb_vsync_interrupt(int irq, void *ptr)
 
 
 static const struct fb_ops ps3fb_ops = {
+	.owner		= THIS_MODULE,
 	.fb_open	= ps3fb_open,
 	.fb_release	= ps3fb_release,
 	.fb_read        = fb_sys_read,
Signature · 1 line
2.40.0
#3 lore raw

PATCH 3/3 fbdev/vfb: Init owner field of struct fb_ops

In reply to Thomas Zimmermann

Initialize the owner field of struct fb_ops. Required to prevent module unloading while the driver is in use.

---
 drivers/video/fbdev/vfb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/fbdev/vfb.c +1 -0
index 680c88267ef4..a0a2009e003e 100644
@@ -79,6 +79,7 @@ static int vfb_mmap(struct fb_info *info,
 		    struct vm_area_struct *vma);
 
 static const struct fb_ops vfb_ops = {
+	.owner		= THIS_MODULE,
 	.fb_read        = fb_sys_read,
 	.fb_write       = fb_sys_write,
 	.fb_check_var	= vfb_check_var,
Signature · 1 line
2.40.0
maintainer
#4 lore raw
In reply to Thomas Zimmermann
Quoted 10 lines · Thomas Zimmermann

Set the owner field of various drivers' fb_ops instance. The setting is required by fbcon, which acquires a reference on the fbdev driver's module. Otherwise, users could attempt to unload the module while it's still in use.

Thomas Zimmermann (3):
fbdev/68328fb: Init owner field of struct fb_ops fbdev/ps3fb: Init owner field of struct fb_ops fbdev/vfb: Init owner field of struct fb_ops

Quoted 5 lines
  drivers/video/fbdev/68328fb.c | 1 +
  drivers/video/fbdev/ps3fb.c   | 1 +
  drivers/video/fbdev/vfb.c     | 1 +
  3 files changed, 3 insertions(+)

Series applied.

Thank you!
Helge