]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
fbdev: uvesafb: fix potential memory leak in uvesafb_probe()
authorAbdun Nihaal <nihaal@cse.iitm.ac.in>
Thu, 14 May 2026 08:24:40 +0000 (13:54 +0530)
committerHelge Deller <deller@gmx.de>
Sun, 7 Jun 2026 16:25:42 +0000 (18:25 +0200)
Due to an incorrect goto label, memory allocated for modedb and modelist
in uvesafb_vbe_init() is not freed in some error paths. Fix this by
updating the goto label.

Fixes: 8bdb3a2d7df4 ("uvesafb: the driver core")
Cc: stable@vger.kernel.org
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/uvesafb.c

index 88667fccc27b9766124c1b940f6f8d729fd27b4b..9d82326c744f220a36f93efb2d484accb61aa851 100644 (file)
@@ -1694,14 +1694,14 @@ static int uvesafb_probe(struct platform_device *dev)
        i = uvesafb_vbe_init_mode(info);
        if (i < 0) {
                err = -EINVAL;
-               goto out;
+               goto out_mode;
        } else {
                mode = &par->vbe_modes[i];
        }
 
        if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {
                err = -ENXIO;
-               goto out;
+               goto out_mode;
        }
 
        uvesafb_init_info(info, mode);