[media] gspca: remove needless check before usb_free_coherent()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 20 Mar 2013 14:30:46 +0000 (11:30 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 23 Mar 2013 13:48:56 +0000 (10:48 -0300)
usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/usb/gspca/gspca.c

index 5800d65f9144b7db36d0faf8b0a11a03c926c58f..924e032461d0d0693937334d082ef62c883591db 100644 (file)
@@ -567,11 +567,10 @@ static void destroy_urbs(struct gspca_dev *gspca_dev)
 
                gspca_dev->urb[i] = NULL;
                usb_kill_urb(urb);
-               if (urb->transfer_buffer != NULL)
-                       usb_free_coherent(gspca_dev->dev,
-                                         urb->transfer_buffer_length,
-                                         urb->transfer_buffer,
-                                         urb->transfer_dma);
+               usb_free_coherent(gspca_dev->dev,
+                                 urb->transfer_buffer_length,
+                                 urb->transfer_buffer,
+                                 urb->transfer_dma);
                usb_free_urb(urb);
        }
 }