Skip to content

Commit

Permalink
fbdev: imsttfb: Release framebuffer and dealloc cmap on error path
Browse files Browse the repository at this point in the history
[ Upstream commit 5cf9a09 ]

Add missing cleanups in error path.

Signed-off-by: Helge Deller <deller@gmx.de>
Stable-dep-of: e08c30e ("fbdev: imsttfb: fix double free in probe()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
hdeller authored and gregkh committed Jan 10, 2024
1 parent 51a1b94 commit f2a79f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/video/fbdev/imsttfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1452,9 +1452,13 @@ static int init_imstt(struct fb_info *info)
FBINFO_HWACCEL_FILLRECT |
FBINFO_HWACCEL_YPAN;

fb_alloc_cmap(&info->cmap, 0, 0);
if (fb_alloc_cmap(&info->cmap, 0, 0)) {
framebuffer_release(info);
return -ENODEV;
}

if (register_framebuffer(info) < 0) {
fb_dealloc_cmap(&info->cmap);
framebuffer_release(info);
return -ENODEV;
}
Expand Down

0 comments on commit f2a79f3

Please sign in to comment.