mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
fbdev: broadsheetfb: fix potential memory leak in broadsheetfb_probe()
The memory allocated for pagerefs in fb_deferred_io_init() is not freed
on the error path. Fix it by calling fb_deferred_io_cleanup().
Fixes: 56c134f7f1 ("fbdev: Track deferred-I/O pages in pageref struct")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
cbef2a305a
commit
9d18a4e423
|
|
@ -1072,12 +1072,14 @@ static int broadsheetfb_probe(struct platform_device *dev)
|
|||
info->flags = FBINFO_VIRTFB;
|
||||
|
||||
info->fbdefio = &broadsheetfb_defio;
|
||||
fb_deferred_io_init(info);
|
||||
retval = fb_deferred_io_init(info);
|
||||
if (retval)
|
||||
goto err_vfree;
|
||||
|
||||
retval = fb_alloc_cmap(&info->cmap, 16, 0);
|
||||
if (retval < 0) {
|
||||
dev_err(&dev->dev, "Failed to allocate colormap\n");
|
||||
goto err_vfree;
|
||||
goto err_fbdefio;
|
||||
}
|
||||
|
||||
/* set cmap */
|
||||
|
|
@ -1121,6 +1123,8 @@ static int broadsheetfb_probe(struct platform_device *dev)
|
|||
board->cleanup(par);
|
||||
err_cmap:
|
||||
fb_dealloc_cmap(&info->cmap);
|
||||
err_fbdefio:
|
||||
fb_deferred_io_cleanup(info);
|
||||
err_vfree:
|
||||
vfree(videomemory);
|
||||
err_fb_rel:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user