Skip to content

Commit 5cf9a09

Browse files
committed
fbdev: imsttfb: Release framebuffer and dealloc cmap on error path
Add missing cleanups in error path. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 780328a commit 5cf9a09

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

drivers/video/fbdev/imsttfb.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,9 +1452,13 @@ static int init_imstt(struct fb_info *info)
14521452
FBINFO_HWACCEL_FILLRECT |
14531453
FBINFO_HWACCEL_YPAN;
14541454

1455-
fb_alloc_cmap(&info->cmap, 0, 0);
1455+
if (fb_alloc_cmap(&info->cmap, 0, 0)) {
1456+
framebuffer_release(info);
1457+
return -ENODEV;
1458+
}
14561459

14571460
if (register_framebuffer(info) < 0) {
1461+
fb_dealloc_cmap(&info->cmap);
14581462
framebuffer_release(info);
14591463
return -ENODEV;
14601464
}

0 commit comments

Comments
 (0)