summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2006-06-19 23:12:38 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-07-13 03:03:22 +0400
commitb40b7a905ce57608ca93c5032d5ab1f5508d2f11 (patch)
tree90a903dd48e9b9e3908f0a506704d039011bb204 /drivers/usb
parenteecd11ed47c8c9bd8e7e3dff35baccae18dd0d84 (diff)
downloadlinux-b40b7a905ce57608ca93c5032d5ab1f5508d2f11.tar.xz
[PATCH] USB hub: don't return status > 0 from resume
finish_device_resume() in the hub driver isn't careful always to return a negative code in all the error pathways. It also doesn't return 0 in all the success pathways. This patch (as724) fixes the behavior. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 875596e98e42..41531bba4321 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1790,7 +1790,10 @@ static int finish_device_resume(struct usb_device *udev)
* and device drivers will know about any resume quirks.
*/
status = usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus);
- if (status < 2)
+ if (status >= 0)
+ status = (status == 2 ? 0 : -ENODEV);
+
+ if (status)
dev_dbg(&udev->dev,
"gone after usb resume? status %d\n",
status);