diff mbox

zr364xx.c: vfree does its own NULL check

Message ID 1244279782.3185.9.camel@myhost (mailing list archive)
State Accepted
Delegated to: Douglas Landgraf
Headers show

Commit Message

Figo.zhang June 6, 2009, 9:16 a.m. UTC
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(-)


 

 
 


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Figo.zhang June 15, 2009, 4:02 p.m. UTC | #1
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;
>  }
>  
> 
> 
> 
> 
> 
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 }