Skip to contentSkip to conversation

usb: remove unneeded NULL check in usb_disconnect()

PATCH New Dan Carpenter 1 participant 1 message Jun 29, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: remove unneeded NULL check in usb_disconnect()

We dereference "udev" and then immediately check whether it's NULL which makes the static checkers complain. "udev" isn't NULL here so the check can be removed.

---
Alan Stern says it can never be NULL and I double checked as well. usb_disconnect() is only called from hub.c and hcd.c.

drivers/usb/core/hub.c +0 -5
index a428aa0..99fff6b 100644
@@ -1636,11 +1636,6 @@ void usb_disconnect(struct usb_device **pdev)
 	int			i;
 	struct usb_hcd		*hcd = bus_to_hcd(udev->bus);
 
-	if (!udev) {
-		pr_debug ("%s nodev\n", __func__);
-		return;
-	}
-
 	/* mark the device as inactive, so any further urb submissions for
 	 * this device (and any of its children) will fail immediately.
 	 * this quiesces everything except pending urbs.