diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-04-29 09:06:53 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-05-04 07:41:11 +0200 |
commit | ed694c06e2b1d71711186889be80974d112bd4b4 (patch) | |
tree | 55693be944871454794d0e22cb68ba9761bfaacc | |
parent | 0d26ce1c11a14fb844f8ed0fb5069c903a0b2185 (diff) | |
download | barebox-ed694c06e2b1d71711186889be80974d112bd4b4.tar.gz barebox-ed694c06e2b1d71711186889be80974d112bd4b4.tar.xz |
video: ssd1307fb: fix null pointer dereference on error
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@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/video/ssd1307fb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/ssd1307fb.c b/drivers/video/ssd1307fb.c index 835814bf53..45f479b0ef 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; |