[PATCH] fbdev: clps711x-fb: unregister fb when clps711x_fb_probe register failed

Russell King (Oracle) linux at armlinux.org.uk
Thu Oct 3 16:18:39 UTC 2024


On Fri, Oct 04, 2024 at 12:12:36AM +0800, clingfei wrote:
> When register_framebuffer failed, it jumps out_fb_dealloc_cmap without
> calling unregister_framebuffer, which may cause potential memory leak.

This looks completely wrong. If register_framebuffer() fails, then the
work that register_framebuffer() does internally should be cleaned up
and unregister_framebuffer() should not be necessary.

The code looks correct as-is to me, so there's no need to patch it.
If there is a memory leak, that'll be in register_framebuffer() itself.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!


More information about the dri-devel mailing list