summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/omap/lcd_mipid.c
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2023-06-04 18:42:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-11 12:33:37 +0300
commitd97840bf5a388c6cbf6e46216887bf17be62acc2 (patch)
tree126d73d62061eb5bd0a61bed516bb4a4ab298e22 /drivers/video/fbdev/omap/lcd_mipid.c
parentc8e74aa9fa829518b934765a3405247d6b7add05 (diff)
downloadlinux-d97840bf5a388c6cbf6e46216887bf17be62acc2.tar.xz
fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
[ Upstream commit 79a3908d1ea6c35157a6d907b1a9d8ec06015e7a ] If 'mipid_detect()' fails, we must free 'md' to avoid a memory leak. Fixes: 66d2f99d0bb5 ("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>
Diffstat (limited to 'drivers/video/fbdev/omap/lcd_mipid.c')
-rw-r--r--drivers/video/fbdev/omap/lcd_mipid.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/video/fbdev/omap/lcd_mipid.c b/drivers/video/fbdev/omap/lcd_mipid.c
index e3a85432f926..5730355ee598 100644
--- a/drivers/video/fbdev/omap/lcd_mipid.c
+++ b/drivers/video/fbdev/omap/lcd_mipid.c
@@ -576,11 +576,15 @@ static int mipid_spi_probe(struct spi_device *spi)
r = mipid_detect(md);
if (r < 0)
- return r;
+ goto free_md;
omapfb_register_panel(&md->panel);
return 0;
+
+free_md:
+ kfree(md);
+ return r;
}
static int mipid_spi_remove(struct spi_device *spi)