diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2014-11-21 10:33:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-24 20:23:41 -0500 |
commit | 03f3df817dd3bf988c6d56e10e99b5b4553f5044 (patch) | |
tree | 1466da76af9282f880a2ff8c3452573ecd5de2ab /drivers/usb/usbip | |
parent | 0bfed505447dd5a47e6097a32d216d7df7cf70aa (diff) |
USB-IP: Deletion of unnecessary checks before the function call "usb_put_dev"
The usb_put_dev() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Valentina Manea <valentina.manea.m@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/usbip')
-rw-r--r-- | drivers/usb/usbip/vhci_hcd.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index c02374b6049c..cc1b03eccf4a 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c | |||
@@ -518,8 +518,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
518 | dev_info(dev, "SetAddress Request (%d) to port %d\n", | 518 | dev_info(dev, "SetAddress Request (%d) to port %d\n", |
519 | ctrlreq->wValue, vdev->rhport); | 519 | ctrlreq->wValue, vdev->rhport); |
520 | 520 | ||
521 | if (vdev->udev) | 521 | usb_put_dev(vdev->udev); |
522 | usb_put_dev(vdev->udev); | ||
523 | vdev->udev = usb_get_dev(urb->dev); | 522 | vdev->udev = usb_get_dev(urb->dev); |
524 | 523 | ||
525 | spin_lock(&vdev->ud.lock); | 524 | spin_lock(&vdev->ud.lock); |
@@ -539,8 +538,7 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, | |||
539 | usbip_dbg_vhci_hc( | 538 | usbip_dbg_vhci_hc( |
540 | "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); | 539 | "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); |
541 | 540 | ||
542 | if (vdev->udev) | 541 | usb_put_dev(vdev->udev); |
543 | usb_put_dev(vdev->udev); | ||
544 | vdev->udev = usb_get_dev(urb->dev); | 542 | vdev->udev = usb_get_dev(urb->dev); |
545 | goto out; | 543 | goto out; |
546 | 544 | ||
@@ -831,8 +829,7 @@ static void vhci_device_reset(struct usbip_device *ud) | |||
831 | vdev->speed = 0; | 829 | vdev->speed = 0; |
832 | vdev->devid = 0; | 830 | vdev->devid = 0; |
833 | 831 | ||
834 | if (vdev->udev) | 832 | usb_put_dev(vdev->udev); |
835 | usb_put_dev(vdev->udev); | ||
836 | vdev->udev = NULL; | 833 | vdev->udev = NULL; |
837 | 834 | ||
838 | if (ud->tcp_socket) { | 835 | if (ud->tcp_socket) { |