All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] zr364xx.c: vfree does its own NULL check
@ 2009-06-06  9:16 Figo.zhang
  2009-06-15 16:02 ` Figo.zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Figo.zhang @ 2009-06-06  9:16 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

vfree() does it's own NULL checking, no need for explicit check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
--- 
 drivers/media/video/zr364xx.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index ac169c9..fc976f4 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -882,9 +882,11 @@ static void zr364xx_disconnect(struct usb_interface *intf)
 		video_unregister_device(cam->vdev);
 	cam->vdev = NULL;
 	kfree(cam->buffer);
-	if (cam->framebuf)
-		vfree(cam->framebuf);
+	cam->buffer = NULL;
+	vfree(cam->framebuf);
+	cam->framebuf = NULL;
 	kfree(cam);
+	cam = NULL;
 }
 
 

 

 
 



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

* Re: [PATCH] zr364xx.c: vfree does its own NULL check
  2009-06-06  9:16 [PATCH] zr364xx.c: vfree does its own NULL check Figo.zhang
@ 2009-06-15 16:02 ` Figo.zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Figo.zhang @ 2009-06-15 16:02 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

hi Mauro,
is it ok for this patch?

Best Regards,

Figo.zhang


On Sat, 2009-06-06 at 17:16 +0800, Figo.zhang wrote:
> vfree() does it's own NULL checking, no need for explicit check before
> calling it.
> 
> Signed-off-by: Figo.zhang <figo1802@gmail.com>
> --- 
>  drivers/media/video/zr364xx.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
> index ac169c9..fc976f4 100644
> --- a/drivers/media/video/zr364xx.c
> +++ b/drivers/media/video/zr364xx.c
> @@ -882,9 +882,11 @@ static void zr364xx_disconnect(struct usb_interface *intf)
>  		video_unregister_device(cam->vdev);
>  	cam->vdev = NULL;
>  	kfree(cam->buffer);
> -	if (cam->framebuf)
> -		vfree(cam->framebuf);
> +	cam->buffer = NULL;
> +	vfree(cam->framebuf);
> +	cam->framebuf = NULL;
>  	kfree(cam);
> +	cam = NULL;
>  }
>  
> 
> 
> 
> 
> 
> 
> 


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

end of thread, other threads:[~2009-06-15 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-06  9:16 [PATCH] zr364xx.c: vfree does its own NULL check Figo.zhang
2009-06-15 16:02 ` Figo.zhang

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.