diff mbox series

media: flexcop-usb: remove needless check before usb_free_coherent()

Message ID 20200914061513.3512-1-miaoqinglang@huawei.com
State Accepted
Commit cf580e11fb6c94bc995dddc55489c65d0499cdd9
Headers show
Series media: flexcop-usb: remove needless check before usb_free_coherent() | expand

Commit Message

'Qinglang Miao Sept. 14, 2020, 6:15 a.m. UTC
usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
---
 drivers/media/usb/b2c2/flexcop-usb.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c
index 198ddfb8d..12c0b40be 100644
--- a/drivers/media/usb/b2c2/flexcop-usb.c
+++ b/drivers/media/usb/b2c2/flexcop-usb.c
@@ -419,10 +419,9 @@  static void flexcop_usb_transfer_exit(struct flexcop_usb *fc_usb)
 			usb_free_urb(fc_usb->iso_urb[i]);
 		}
 
-	if (fc_usb->iso_buffer != NULL)
-		usb_free_coherent(fc_usb->udev,
-			fc_usb->buffer_size, fc_usb->iso_buffer,
-			fc_usb->dma_addr);
+	usb_free_coherent(fc_usb->udev, fc_usb->buffer_size,
+			  fc_usb->iso_buffer, fc_usb->dma_addr);
+
 }
 
 static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)