summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/yurex.c
diff options
context:
space:
mode:
authorXu Wang <vulab@iscas.ac.cn>2020-08-10 02:08:02 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-08-18 12:12:58 +0200
commit4d671957d45346decb1a9d488921cf90c19e0d0f (patch)
tree962542536df19cb3d63de24c0a6c0a70b1eebdfa /drivers/usb/misc/yurex.c
parent1100395dc47cb78cab519f33a6a28cd3f1773ea4 (diff)
USB: yurex: remove needless check before usb_free_coherent()
usb_free_coherent() is safe with NULL addr and this check is not required. Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Link: https://lore.kernel.org/r/20200810020802.9082-1-vulab@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/yurex.c')
-rw-r--r--drivers/usb/misc/yurex.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
index 6e7d34e7fec4..2063ef071393 100644
--- a/drivers/usb/misc/yurex.c
+++ b/drivers/usb/misc/yurex.c
@@ -96,15 +96,13 @@ static void yurex_delete(struct kref *kref)
if (dev->cntl_urb) {
usb_kill_urb(dev->cntl_urb);
kfree(dev->cntl_req);
- if (dev->cntl_buffer)
- usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
+ usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
dev->cntl_buffer, dev->cntl_urb->transfer_dma);
usb_free_urb(dev->cntl_urb);
}
if (dev->urb) {
usb_kill_urb(dev->urb);
- if (dev->int_buffer)
- usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
+ usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
dev->int_buffer, dev->urb->transfer_dma);
usb_free_urb(dev->urb);
}