Commit 08a6caae authored by Xu Wang's avatar Xu Wang Committed by Dmitry Torokhov

Input: cm109 - remove needless check before usb_free_coherent()

usb_free_coherent() is safe with NULL addr and this check is
not required.
Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Link: https://lore.kernel.org/r/20200707030905.3123-1-vulab@iscas.ac.cnSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent deae5764
......@@ -663,12 +663,8 @@ static const struct usb_device_id cm109_usb_table[] = {
static void cm109_usb_cleanup(struct cm109_dev *dev)
{
kfree(dev->ctl_req);
if (dev->ctl_data)
usb_free_coherent(dev->udev, USB_PKT_LEN,
dev->ctl_data, dev->ctl_dma);
if (dev->irq_data)
usb_free_coherent(dev->udev, USB_PKT_LEN,
dev->irq_data, dev->irq_dma);
usb_free_coherent(dev->udev, USB_PKT_LEN, dev->ctl_data, dev->ctl_dma);
usb_free_coherent(dev->udev, USB_PKT_LEN, dev->irq_data, dev->irq_dma);
usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */
usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment