Skip to content

Commit 08a6caa

Browse files
ISCAS-Vulabdtor
authored andcommitted
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: Xu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent deae576 commit 08a6caa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

drivers/input/misc/cm109.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,8 @@ static const struct usb_device_id cm109_usb_table[] = {
663663
static void cm109_usb_cleanup(struct cm109_dev *dev)
664664
{
665665
kfree(dev->ctl_req);
666-
if (dev->ctl_data)
667-
usb_free_coherent(dev->udev, USB_PKT_LEN,
668-
dev->ctl_data, dev->ctl_dma);
669-
if (dev->irq_data)
670-
usb_free_coherent(dev->udev, USB_PKT_LEN,
671-
dev->irq_data, dev->irq_dma);
666+
usb_free_coherent(dev->udev, USB_PKT_LEN, dev->ctl_data, dev->ctl_dma);
667+
usb_free_coherent(dev->udev, USB_PKT_LEN, dev->irq_data, dev->irq_dma);
672668

673669
usb_free_urb(dev->urb_irq); /* parameter validation in core/urb */
674670
usb_free_urb(dev->urb_ctl); /* parameter validation in core/urb */

0 commit comments

Comments
 (0)