Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

The driver calls register_framebuffer() in probe but does not call
unregister_framebuffer() in remove.
Rename current remove to __s1d13xxxfb_remove() for error handler.
Then add a new remove to call unregister_framebuffer().

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
[b.zolnierkie: ported over recent s1d13xxxfb changes]
[b.zolnierkie: removed extra newline]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200324132311.21729-1-hslester96@gmail.com

authored by

Chuhong Yuan and committed by
Bartlomiej Zolnierkiewicz
8213fb41 5e4096ef

+10 -4
+10 -4
drivers/video/fbdev/s1d13xxxfb.c
··· 721 721 xres, yres, xres_virtual, yres_virtual, is_color, is_dual, is_tft); 722 722 } 723 723 724 - 725 - static int 726 - s1d13xxxfb_remove(struct platform_device *pdev) 724 + static void __s1d13xxxfb_remove(struct platform_device *pdev) 727 725 { 728 726 struct fb_info *info = platform_get_drvdata(pdev); 729 727 struct s1d13xxxfb_par *par = NULL; ··· 747 749 resource_size(&pdev->resource[0])); 748 750 release_mem_region(pdev->resource[1].start, 749 751 resource_size(&pdev->resource[1])); 752 + } 753 + 754 + static int s1d13xxxfb_remove(struct platform_device *pdev) 755 + { 756 + struct fb_info *info = platform_get_drvdata(pdev); 757 + 758 + unregister_framebuffer(info); 759 + __s1d13xxxfb_remove(pdev); 750 760 return 0; 751 761 } 752 762 ··· 901 895 return 0; 902 896 903 897 bail: 904 - s1d13xxxfb_remove(pdev); 898 + __s1d13xxxfb_remove(pdev); 905 899 return ret; 906 900 907 901 }