]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fbdev: au1200fb: Fix a memory leak in au1200fb_drv_probe()
authorFelix Gu <ustc.gu@gmail.com>
Tue, 3 Feb 2026 12:14:58 +0000 (20:14 +0800)
committerHelge Deller <deller@gmx.de>
Sat, 14 Feb 2026 10:09:47 +0000 (11:09 +0100)
In au1200fb_drv_probe(), when platform_get_irq fails(), it directly
returns from the function with an error code, which causes a memory
leak.

Replace it with a goto label to ensure proper cleanup.

Fixes: 4e88761f5f8c ("fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/au1200fb.c

index ed770222660b515fde3ca95ae41ea7ebff6be7c3..685e629e7e1642aa2f20ffea30f21f36161539d7 100644 (file)
@@ -1724,8 +1724,10 @@ static int au1200fb_drv_probe(struct platform_device *dev)
 
        /* Now hook interrupt too */
        irq = platform_get_irq(dev, 0);
-       if (irq < 0)
-               return irq;
+       if (irq < 0) {
+               ret = irq;
+               goto failed;
+       }
 
        ret = request_irq(irq, au1200fb_handle_irq,
                          IRQF_SHARED, "lcd", (void *)dev);