staging: keucr: remove needless check before usb_free_coherent()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 23 May 2013 09:28:34 +0000 (17:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2013 11:46:26 +0000 (20:46 +0900)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/keucr/usb.c

index efadfcf64cbe39a3df79e3dfc0e51b8300b7a208..0608a5c6b2c0ddf948b1791b7fe1318ca7051ffc 100644 (file)
@@ -442,12 +442,9 @@ static void dissociate_dev(struct us_data *us)
        kfree(us->sensebuf);
 
        /* Free the device-related DMA-mapped buffers */
-       if (us->cr)
-               usb_free_coherent(us->pusb_dev, sizeof(*us->cr), us->cr,
-                                                               us->cr_dma);
-       if (us->iobuf)
-               usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
-                                                               us->iobuf_dma);
+       usb_free_coherent(us->pusb_dev, sizeof(*us->cr), us->cr, us->cr_dma);
+       usb_free_coherent(us->pusb_dev, US_IOBUF_SIZE, us->iobuf,
+                         us->iobuf_dma);
 
        /* Remove our private data from the interface */
        usb_set_intfdata(us->pusb_intf, NULL);