mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] video: ssd1307fb: fix null pointer dereference on error
@ 2020-04-29  7:06 Ahmad Fatoum
  2020-05-04  5:43 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2020-04-29  7:06 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] video: ssd1307fb: fix null pointer dereference on error
  2020-04-29  7:06 [PATCH] video: ssd1307fb: fix null pointer dereference on error Ahmad Fatoum
@ 2020-05-04  5:43 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2020-05-04  5:43 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Wed, Apr 29, 2020 at 09:06:53AM +0200, Ahmad Fatoum wrote:
> 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>
> ---
>  drivers/video/ssd1307fb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> 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@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-04  5:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  7:06 [PATCH] video: ssd1307fb: fix null pointer dereference on error Ahmad Fatoum
2020-05-04  5:43 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox