[PATCH] video: ssd1307fb: fix null pointer dereference on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On error, a goto may jump over the initialization of vmem and free the
uninitialized value during clean up. Fix this.

Found by compiling the code with clang.

Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/video/ssd1307fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c
index 835814bf5306..45f479b0efdc 100644
--- a/drivers/video/ssd1307fb.c
+++ b/drivers/video/ssd1307fb.c
@@ -395,7 +395,7 @@ static int ssd1307fb_probe(struct device_d *dev)
 	u32 vmem_size;
 	struct ssd1307fb_par *par;
 	struct ssd1307fb_array *array;
-	u8 *vmem;
+	u8 *vmem = NULL;
 	int ret;
 	int i, j;
 
-- 
2.26.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux