summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Hesselbarth <sebastian.hesselbarth@gmail.com>2014-07-26 17:24:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-07-28 07:31:17 +0200
commit422cd55ca880786a013244dd61ca7a7b978e7d22 (patch)
tree3cbf948485b1db712256435fa50a27dfdab7a842
parent7d643b416dd2cdcd39307b4d51afb5e1da8a65c1 (diff)
downloadbarebox-422cd55ca880786a013244dd61ca7a7b978e7d22.tar.gz
barebox-422cd55ca880786a013244dd61ca7a7b978e7d22.tar.xz
USB: Fix stale usb devices in usb_device_list
New usb devices are added to a list of usb devices, but when removing the corresponding usb_device it was not removed from that list. Fix it by deleting it properly from the usb_device_list. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/core/usb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index fdf9d94a52..201b84e0ee 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -471,6 +471,7 @@ void usb_remove_device(struct usb_device *usbdev)
dev_err(&usbdev->dev, "failed to unregister\n");
usbdev->parent->children[usbdev->portnr - 1] = NULL;
+ list_del(&usbdev->list);
free(usbdev);
}