Commit 70244527 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

[PATCH] USB: Check port reset return code

This patch adds checking for the SET-FEATURE request that actually does a
port reset.  Without the check, the hub driver just assumes that the port
reset command actually was transferred okay.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 15903813
...@@ -1150,10 +1150,14 @@ static int hub_port_reset(struct usb_device *hdev, int port, ...@@ -1150,10 +1150,14 @@ static int hub_port_reset(struct usb_device *hdev, int port,
/* Reset the port */ /* Reset the port */
for (i = 0; i < PORT_RESET_TRIES; i++) { for (i = 0; i < PORT_RESET_TRIES; i++) {
set_port_feature(hdev, port + 1, USB_PORT_FEAT_RESET); status = set_port_feature(hdev, port + 1, USB_PORT_FEAT_RESET);
if (status)
dev_err(hub_dev, "cannot reset port %d (err = %d)\n",
port + 1, status);
else
status = hub_port_wait_reset(hdev, port, udev, delay);
/* return on disconnect or reset */ /* return on disconnect or reset */
status = hub_port_wait_reset(hdev, port, udev, delay);
if (status == -ENOTCONN || status == 0) { if (status == -ENOTCONN || status == 0) {
clear_port_feature(hdev, clear_port_feature(hdev,
port + 1, USB_PORT_FEAT_C_RESET); port + 1, USB_PORT_FEAT_C_RESET);
......
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