video: fbdev: vesafb: add missed release_region
PATCH v2 1/1 video: fbdev: vesafb: add missed release_region
The driver forgets to free the requested irq in remove and probe failure.
Add the missed calls to fix it.
---
Changes in v2:
- Modify commit message.
drivers/video/fbdev/vesafb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/video/fbdev/vesafb.c +2 -0
@@ -468,6 +468,7 @@ static int vesafb_probe(struct platform_device *dev)fb_info (info,"%s frame buffer device\n" , info->fix.id);return 0 ; err: +release_region (0x3c0 ,32 );arch_phys_wc_del (par->wc_cookie);if (info->screen_base)iounmap (info->screen_base);
@@ -480,6 +481,7 @@ static int vesafb_remove(struct platform_device *pdev) {struct fb_info *info =platform_get_drvdata (pdev); +release_region (0x3c0 ,32 );unregister_framebuffer (info);framebuffer_release (info);
Signature · 1 line
2.24.0
Quoted 2 lines · Chuhong Yuan
The driver forgets to free the requested irq in remove and probe failure.
This is I/O region not IRQ.
Quoted 15 lines
Add the missed calls to fix it.
Signed-off-by Chuhong Yuan <[email protected]>---
Changes in v2:
- Modify commit message.drivers/video/fbdev/vesafb.c | 2 ++ 1 file changed, 2 insertions(+)drivers/video/fbdev/vesafb.c +0
-0
drivers/video/fbdev/vesafb.c static int vesafb_probe(struct platform_device *dev) · line 471
Quoted 4 lines
drivers/video/fbdev/vesafb.c +1
-0@@ -468,6 +468,7 @@ static int vesafb_probe(struct platform_device *dev)fb_info (info,"%s frame buffer device\n" , info->fix.id);return 0 ; err: +release_region (0x3c0 ,32 );
There is one 'goto err;' instance before request_region() which needs to be taken care of first.
drivers/video/fbdev/vesafb.c static int vesafb_remove(struct platform_device *pdev) · line 485
Quoted 9 lines
drivers/video/fbdev/vesafb.c +1
-0arch_phys_wc_del (par->wc_cookie);if (info->screen_base)iounmap (info->screen_base);@@ -480,6 +481,7 @@ static int vesafb_remove(struct platform_device *pdev) {struct fb_info *info =platform_get_drvdata (pdev); +release_region (0x3c0 ,32 );unregister_framebuffer (info);
The order of operations on remove should be the reverse of order of operations on probe.
[ We cannot release I/O region while framebuffer is active. ]
drivers/video/fbdev/vesafb.c static int vesafb_remove(struct platform_device *pdev) · line 486
Quoted 1 line
drivers/video/fbdev/vesafb.c +0
-0framebuffer_release (info);
Please fix the patch and re-submit.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics