All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix possible leak in fbcon code.
@ 2004-09-01 15:51 Dave Jones
  2004-09-05 20:54 ` Denis Vlasenko
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2004-09-01 15:51 UTC (permalink / raw)
  To: linux-kernel

Spotted with the source checker from Coverity.com.

Signed-off-by: Dave Jones <davej@redhat.com>


diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/video/console/fbcon.c linux-2.6/drivers/video/console/fbcon.c
--- bk-linus/drivers/video/console/fbcon.c	2004-08-24 00:02:40.000000000 +0100
+++ linux-2.6/drivers/video/console/fbcon.c	2004-09-01 13:31:12.000000000 +0100
@@ -983,6 +983,7 @@ static void fbcon_init(struct vc_data *v
 			vc->vc_y += logo_lines;
 			vc->vc_pos += logo_lines * vc->vc_size_row;
 			kfree(save);
+			save = NULL;
 		}
 		if (logo_lines > vc->vc_bottom) {
 			logo_shown = -1;
@@ -1004,6 +1005,8 @@ static void fbcon_init(struct vc_data *v
 			softback_top = 0;
 		}
 	}
+	if (save)
+		kfree(save);
 }
 
 static void fbcon_deinit(struct vc_data *vc)

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

* Re: [PATCH] Fix possible leak in fbcon code.
  2004-09-01 15:51 [PATCH] Fix possible leak in fbcon code Dave Jones
@ 2004-09-05 20:54 ` Denis Vlasenko
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Vlasenko @ 2004-09-05 20:54 UTC (permalink / raw)
  To: Dave Jones, linux-kernel

On Wednesday 01 September 2004 18:51, Dave Jones wrote:
> Spotted with the source checker from Coverity.com.
>
> Signed-off-by: Dave Jones <davej@redhat.com>
>
>
> diff -urpN --exclude-from=/home/davej/.exclude
> bk-linus/drivers/video/console/fbcon.c
> linux-2.6/drivers/video/console/fbcon.c ---
> bk-linus/drivers/video/console/fbcon.c	2004-08-24 00:02:40.000000000 +0100
> +++ linux-2.6/drivers/video/console/fbcon.c	2004-09-01 13:31:12.000000000
> +0100 @@ -983,6 +983,7 @@ static void fbcon_init(struct vc_data *v
>  			vc->vc_y += logo_lines;
>  			vc->vc_pos += logo_lines * vc->vc_size_row;
>  			kfree(save);
> +			save = NULL;
>  		}
>  		if (logo_lines > vc->vc_bottom) {
>  			logo_shown = -1;
> @@ -1004,6 +1005,8 @@ static void fbcon_init(struct vc_data *v
>  			softback_top = 0;
>  		}
>  	}
> +	if (save)
> +		kfree(save);
>  }
>
>  static void fbcon_deinit(struct vc_data *vc)

kfree(NULL) is valid (it's a nop).
--
vda


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

end of thread, other threads:[~2004-09-05 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-01 15:51 [PATCH] Fix possible leak in fbcon code Dave Jones
2004-09-05 20:54 ` Denis Vlasenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.