diff mbox series

net: zydas: remove needless check before usb_free_coherent()

Message ID 20200630070404.8207-1-vulab@iscas.ac.cn
State Accepted
Commit 4f3ebd6fb6806a948df9eb1dc7ea9bb76e2712ec
Delegated to: Kalle Valo
Headers show
Series net: zydas: remove needless check before usb_free_coherent() | expand

Commit Message

Xu Wang June 30, 2020, 7:04 a.m. UTC
From: Xu Wang <vulab@iscas.ac.cn>

usb_free_coherent() is safe with NULL addr and this check is
not required.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Kalle Valo July 15, 2020, 4:46 p.m. UTC | #1
Chen Ni <vulab@iscas.ac.cn> wrote:

> From: Xu Wang <vulab@iscas.ac.cn>
> 
> usb_free_coherent() is safe with NULL addr and this check is
> not required.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Patch applied to wireless-drivers-next.git, thanks.

4f3ebd6fb680 zd1211rw: remove needless check before usb_free_coherent()
diff mbox series

Patch

diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
index 8ff0374126e4..65b5985ad402 100644
--- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
@@ -600,9 +600,7 @@  void zd_usb_disable_int(struct zd_usb *usb)
 	dev_dbg_f(zd_usb_dev(usb), "urb %p killed\n", urb);
 	usb_free_urb(urb);
 
-	if (buffer)
-		usb_free_coherent(udev, USB_MAX_EP_INT_BUFFER,
-				  buffer, buffer_dma);
+	usb_free_coherent(udev, USB_MAX_EP_INT_BUFFER, buffer, buffer_dma);
 }
 
 static void handle_rx_packet(struct zd_usb *usb, const u8 *buffer,