Commit 03f3df81 authored by Markus Elfring's avatar Markus Elfring Committed by Greg Kroah-Hartman

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Acked-by: default avatarValentina Manea <valentina.manea.m@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0bfed505
...@@ -518,7 +518,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -518,7 +518,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
dev_info(dev, "SetAddress Request (%d) to port %d\n", dev_info(dev, "SetAddress Request (%d) to port %d\n",
ctrlreq->wValue, vdev->rhport); ctrlreq->wValue, vdev->rhport);
if (vdev->udev)
usb_put_dev(vdev->udev); usb_put_dev(vdev->udev);
vdev->udev = usb_get_dev(urb->dev); vdev->udev = usb_get_dev(urb->dev);
...@@ -539,7 +538,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, ...@@ -539,7 +538,6 @@ static int vhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
usbip_dbg_vhci_hc( usbip_dbg_vhci_hc(
"Not yet?:Get_Descriptor to device 0 (get max pipe size)\n"); "Not yet?:Get_Descriptor to device 0 (get max pipe size)\n");
if (vdev->udev)
usb_put_dev(vdev->udev); usb_put_dev(vdev->udev);
vdev->udev = usb_get_dev(urb->dev); vdev->udev = usb_get_dev(urb->dev);
goto out; goto out;
...@@ -831,7 +829,6 @@ static void vhci_device_reset(struct usbip_device *ud) ...@@ -831,7 +829,6 @@ static void vhci_device_reset(struct usbip_device *ud)
vdev->speed = 0; vdev->speed = 0;
vdev->devid = 0; vdev->devid = 0;
if (vdev->udev)
usb_put_dev(vdev->udev); usb_put_dev(vdev->udev);
vdev->udev = NULL; vdev->udev = NULL;
......
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