projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9561de3
)
fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Sun, 4 Jun 2023 15:42:28 +0000
(17:42 +0200)
committer
Helge Deller
<deller@gmx.de>
Mon, 5 Jun 2023 09:34:36 +0000
(11:34 +0200)
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>
drivers/video/fbdev/omap/lcd_mipid.c
patch
|
blob
|
history
diff --git
a/drivers/video/fbdev/omap/lcd_mipid.c
b/drivers/video/fbdev/omap/lcd_mipid.c
index 03cff39d392db3f67e77f9790ca63d02a3dd29f9..cc1079aad61f297f0f8b0e63de84c1dfd55f293a 100644
(file)
--- a/
drivers/video/fbdev/omap/lcd_mipid.c
+++ b/
drivers/video/fbdev/omap/lcd_mipid.c
@@
-563,11
+563,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 void mipid_spi_remove(struct spi_device *spi)