From: Greg Kroah-Hartman Date: Mon, 8 Dec 2003 05:58:14 +0000 (-0800) Subject: [PATCH] USB: fix race with hub devices disconnecting while stuff is still happening... X-Git-Tag: v2.6.0~15 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=830a91c95e5c62d8d9be53d37fa63b8f73371265;p=history.git [PATCH] USB: fix race with hub devices disconnecting while stuff is still happening to them. --- diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index dc12ba0c9722..f665eadd35e7 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -692,6 +692,9 @@ static int hub_port_status(struct usb_device *dev, int port, struct usb_hub *hub = usb_get_intfdata(dev->actconfig->interface[0]); int ret; + if (!hub) + return -ENODEV; + ret = get_port_status(dev, port + 1, &hub->status->port); if (ret < 0) dev_err (hubdev (dev),