Skip to contentSkip to conversation

usbvision-core.c: vfree does its own NULL check

PATCH New Figo.zhang 1 participant 1 message Jun 6, 2009 Media (V4L/DVB)

lore
Share & tools
lore

Figo.zhang

author
#0 lore raw

PATCH 1/1 usbvision-core.c: vfree does its own NULL check

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

---
drivers/media/video/usbvision/usbvision-core.c | 14 ++++++--------

 1 files changed, 6 insertions(+), 8 deletions(-)
drivers/media/video/usbvision/usbvision-core.c +6 -8
index 8bc03b9..1603b2b 100644
@@ -390,10 +390,9 @@ int usbvision_scratch_alloc(struct usb_usbvision *usbvision)
 
 void usbvision_scratch_free(struct usb_usbvision *usbvision)
 {
-	if (usbvision->scratch != NULL) {
-		vfree(usbvision->scratch);
-		usbvision->scratch = NULL;
-	}
+	vfree(usbvision->scratch);
+	usbvision->scratch = NULL;
+	
 }
 
 /*
@@ -506,10 +505,9 @@ int usbvision_decompress_alloc(struct usb_usbvision *usbvision)
  */
 void usbvision_decompress_free(struct usb_usbvision *usbvision)
 {
-	if (usbvision->IntraFrameBuffer != NULL) {
-		vfree(usbvision->IntraFrameBuffer);
-		usbvision->IntraFrameBuffer = NULL;
-	}
+	vfree(usbvision->IntraFrameBuffer);
+	usbvision->IntraFrameBuffer = NULL;
+	
 }
 
 /************************************************************