mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
[ Upstream commit79a3908d1e] If 'mipid_detect()' fails, we must free 'md' to avoid a memory leak. Fixes:66d2f99d0b("omapfb: add support for MIPI-DCS compatible LCDs") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
95cb88a853
commit
716efd0898
@@ -563,11 +563,15 @@ static int mipid_spi_probe(struct spi_device *spi)
|
|||||||
|
|
||||||
r = mipid_detect(md);
|
r = mipid_detect(md);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
goto free_md;
|
||||||
|
|
||||||
omapfb_register_panel(&md->panel);
|
omapfb_register_panel(&md->panel);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
free_md:
|
||||||
|
kfree(md);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mipid_spi_remove(struct spi_device *spi)
|
static int mipid_spi_remove(struct spi_device *spi)
|
||||||
|
|||||||
Reference in New Issue
Block a user