diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-10-27 15:04:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-20 11:59:38 +0100 |
commit | 85fd4eb8f6f85c82a0788cd3daa88cef2568c050 (patch) | |
tree | 6f835b3bc7762ef8274a90df0c3ec16737eb2f8d | |
parent | afadf1fad63bfd2880c4c148816af701a76b5596 (diff) | |
download | linux-stable-85fd4eb8f6f85c82a0788cd3daa88cef2568c050.tar.gz linux-stable-85fd4eb8f6f85c82a0788cd3daa88cef2568c050.tar.bz2 linux-stable-85fd4eb8f6f85c82a0788cd3daa88cef2568c050.zip |
fbdev: imsttfb: fix double free in probe()
[ Upstream commit e08c30efda21ef4c0ec084a3a9581c220b442ba9 ]
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: 518ecb6a209f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/video/fbdev/imsttfb.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/video/fbdev/imsttfb.c b/drivers/video/fbdev/imsttfb.c index f4c8677488fb..1b322ac35d86 100644 --- a/drivers/video/fbdev/imsttfb.c +++ b/drivers/video/fbdev/imsttfb.c @@ -1419,7 +1419,6 @@ static int init_imstt(struct fb_info *info) if ((info->var.xres * info->var.yres) * (info->var.bits_per_pixel >> 3) > info->fix.smem_len || !(compute_imstt_regvals(par, info->var.xres, info->var.yres))) { printk("imsttfb: %ux%ux%u not supported\n", info->var.xres, info->var.yres, info->var.bits_per_pixel); - framebuffer_release(info); return -ENODEV; } @@ -1451,14 +1450,11 @@ static int init_imstt(struct fb_info *info) FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_YPAN; - if (fb_alloc_cmap(&info->cmap, 0, 0)) { - framebuffer_release(info); + if (fb_alloc_cmap(&info->cmap, 0, 0)) return -ENODEV; - } if (register_framebuffer(info) < 0) { fb_dealloc_cmap(&info->cmap); - framebuffer_release(info); return -ENODEV; } |