mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 03:27:30 -04:00
fbdev: hecubafb: fix potential memory leak in hecubafb_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:
committed by
Helge Deller
parent
9402555579
commit
cbef2a305a
@@ -192,7 +192,9 @@ static int hecubafb_probe(struct platform_device *dev)
|
||||
info->flags = FBINFO_VIRTFB;
|
||||
|
||||
info->fbdefio = &hecubafb_defio;
|
||||
fb_deferred_io_init(info);
|
||||
retval = fb_deferred_io_init(info);
|
||||
if (retval)
|
||||
goto err_fbdefio;
|
||||
|
||||
retval = register_framebuffer(info);
|
||||
if (retval < 0)
|
||||
@@ -209,6 +211,8 @@ static int hecubafb_probe(struct platform_device *dev)
|
||||
|
||||
return 0;
|
||||
err_fbreg:
|
||||
fb_deferred_io_cleanup(info);
|
||||
err_fbdefio:
|
||||
framebuffer_release(info);
|
||||
err_fballoc:
|
||||
vfree(videomemory);
|
||||
|
||||
Reference in New Issue
Block a user