Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 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>

authored by

Felix Gu and committed by
Helge Deller
ce4e2519 b28da0d0

+4 -2
+4 -2
drivers/video/fbdev/au1200fb.c
··· 1724 1724 1725 1725 /* Now hook interrupt too */ 1726 1726 irq = platform_get_irq(dev, 0); 1727 - if (irq < 0) 1728 - return irq; 1727 + if (irq < 0) { 1728 + ret = irq; 1729 + goto failed; 1730 + } 1729 1731 1730 1732 ret = request_irq(irq, au1200fb_handle_irq, 1731 1733 IRQF_SHARED, "lcd", (void *)dev);