Skip to contentSkip to conversation

video: fbdev: arcfb: add missed free_irq

PATCH In review Chuhong Yuan 2 participants 2 messages Nov 16, 2019 – Jan 15, 2020

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

PATCH 1/1 video: fbdev: arcfb: add missed free_irq

The driver forgets to free irq in remove which is requested in probe.
Add the missed call to fix it.

---
 drivers/video/fbdev/arcfb.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/video/fbdev/arcfb.c +3 -0
index a48741aab240..7aed01f001a4 100644
@@ -590,8 +590,11 @@ static int arcfb_probe(struct platform_device *dev)
 static int arcfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
+	struct arcfb_par *par = info->par;
 
 	if (info) {
+		if (irq)
+			free_irq(par->irq, info);
 		unregister_framebuffer(info);
 		vfree((void __force *)info->screen_base);
 		framebuffer_release(info);
Signature · 1 line
2.24.0
#1 lore raw
Quoted 14 lines · Chuhong Yuan

The driver forgets to free irq in remove which is requested in probe.
Add the missed call to fix it.

---
 drivers/video/fbdev/arcfb.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/video/fbdev/arcfb.c +0 -0
index a48741aab240..7aed01f001a4 100644

drivers/video/fbdev/arcfb.c static int arcfb_probe(struct platform_device *dev) · line 598

Quoted 9 lines
drivers/video/fbdev/arcfb.c +3 -0
@@ -590,8 +590,11 @@ static int arcfb_probe(struct platform_device *dev)
 static int arcfb_remove(struct platform_device *dev)
 {
 	struct fb_info *info = platform_get_drvdata(dev);
+	struct arcfb_par *par = info->par;
 
 	if (info) {
+		if (irq)
+			free_irq(par->irq, info);
 		unregister_framebuffer(info);

We cannot free IRQ while framebuffer is registered (as we can deadlock in arcfb_ioctl()).

Also it seems that ordering in the probe function is wrong (it should not request IRQ or initialize the hardware after registering framebuffer).

drivers/video/fbdev/arcfb.c static int arcfb_probe(struct platform_device *dev) · line 600

Quoted 2 lines
drivers/video/fbdev/arcfb.c +0 -0
 		vfree((void __force *)info->screen_base);
 		framebuffer_release(info);

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics