Skip to content

Commit 79a3908

Browse files
tititiou36hdeller
authored andcommitted
fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
If 'mipid_detect()' fails, we must free 'md' to avoid a memory leak. Fixes: 66d2f99 ("omapfb: add support for MIPI-DCS compatible LCDs") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 9561de3 commit 79a3908

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/video/fbdev/omap/lcd_mipid.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,15 @@ static int mipid_spi_probe(struct spi_device *spi)
563563

564564
r = mipid_detect(md);
565565
if (r < 0)
566-
return r;
566+
goto free_md;
567567

568568
omapfb_register_panel(&md->panel);
569569

570570
return 0;
571+
572+
free_md:
573+
kfree(md);
574+
return r;
571575
}
572576

573577
static void mipid_spi_remove(struct spi_device *spi)

0 commit comments

Comments
 (0)