public inbox for linux-media@vger.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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox