Skip to content

Commit ce4e251

Browse files
outman119hdeller
authored andcommitted
fbdev: au1200fb: Fix a memory leak in au1200fb_drv_probe()
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: 4e88761 ("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>
1 parent b28da0d commit ce4e251

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/video/fbdev/au1200fb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,8 +1724,10 @@ static int au1200fb_drv_probe(struct platform_device *dev)
17241724

17251725
/* Now hook interrupt too */
17261726
irq = platform_get_irq(dev, 0);
1727-
if (irq < 0)
1728-
return irq;
1727+
if (irq < 0) {
1728+
ret = irq;
1729+
goto failed;
1730+
}
17291731

17301732
ret = request_irq(irq, au1200fb_handle_irq,
17311733
IRQF_SHARED, "lcd", (void *)dev);

0 commit comments

Comments
 (0)