Skip to content

Commit e08c30e

Browse files
Dan Carpenterhdeller
authored andcommitted
fbdev: imsttfb: fix double free in probe()
The init_imstt() function calls framebuffer_release() on error and then the probe() function calls it again. It should only be done in probe. Fixes: 518ecb6 ("fbdev: imsttfb: Fix error path of imsttfb_probe()") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 3e91a38 commit e08c30e

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/video/fbdev/imsttfb.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,6 @@ static int init_imstt(struct fb_info *info)
14211421
if ((info->var.xres * info->var.yres) * (info->var.bits_per_pixel >> 3) > info->fix.smem_len
14221422
|| !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) {
14231423
printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel);
1424-
framebuffer_release(info);
14251424
return -ENODEV;
14261425
}
14271426

@@ -1453,14 +1452,11 @@ static int init_imstt(struct fb_info *info)
14531452
FBINFO_HWACCEL_FILLRECT |
14541453
FBINFO_HWACCEL_YPAN;
14551454

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

14611458
if (register_framebuffer(info) < 0) {
14621459
fb_dealloc_cmap(&info->cmap);
1463-
framebuffer_release(info);
14641460
return -ENODEV;
14651461
}
14661462

0 commit comments

Comments
 (0)