V4L/DVB (11958): usbvision-core.c: vfree does its own NULL check
authorFigo.zhang <figo1802@gmail.com>
Thu, 11 Jun 2009 13:33:31 +0000 (10:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 16 Jun 2009 22:07:37 +0000 (19:07 -0300)
vfree() does it's own NULL checking,so no need for check before
calling it.

Signed-off-by: Figo.zhang <figo1802@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/usbvision/usbvision-core.c

index 8bc03b9e1315b2a517df95392b2cd76b97b08bcd..6ba16abeebdd61af7c03e310a7e6b0b0441056b1 100644 (file)
@@ -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;
+
 }
 
 /************************************************************