[PATCH 05/14] fbdev: carminefb: fix potential memory leak in alloc_carmine_fb()

From
Abdun Nihaal <hidden>
Date
2026-05-14 08:25:25
Also in
dri-devel, lkml, stable
Reply to
Abdun Nihaal, 2026-05-14
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: <redacted>
Signed-off-by: Abdun Nihaal <redacted>
---
 drivers/video/fbdev/carminefb.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/carminefb.c b/drivers/video/fbdev/carminefb.c
index 5f13f1cc79d3..fca50b7961eb 100644
--- a/drivers/video/fbdev/carminefb.c
+++ b/drivers/video/fbdev/carminefb.c
@@ -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);
-- 
2.43.0
Thread (21 messages) 21 messages, 3 authors, last reply 2026-05-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help