]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: carminefb: fix potential memory leak in alloc_carmine_fb()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 14 May 2026 08:24:34 +0000 (13:54 +0530)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
The memory allocated for modelist in fb_videomode_to_modelist() is not
freed in the subsequent error path.
Fix that by calling fb_destroy_modelist()

Fixes: 2ece5f43b041 ("fbdev: add the carmine FB driver")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/carminefb.c

index 5f13f1cc79d3870fb2b84c273b1ea6b84526b900..fca50b7961eb3cfde59a1fa95c860777a012dfa1 100644 (file)
@@ -589,6 +589,7 @@ static int alloc_carmine_fb(void __iomem *regs, void __iomem *smem_base,
        return 0;
 
 err_dealloc_cmap:
+       fb_destroy_modelist(&info->modelist);
        fb_dealloc_cmap(&info->cmap);
 err_free_fb:
        framebuffer_release(info);