diff options
-rw-r--r-- | drivers/usb/host/xhci-hub.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 191ebc54cc7..770f84cb732 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
@@ -418,6 +418,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
418 | wIndex--; | 418 | wIndex--; |
419 | status = 0; | 419 | status = 0; |
420 | temp = xhci_readl(xhci, port_array[wIndex]); | 420 | temp = xhci_readl(xhci, port_array[wIndex]); |
421 | if (temp == 0xffffffff) { | ||
422 | retval = -ENODEV; | ||
423 | break; | ||
424 | } | ||
421 | xhci_dbg(xhci, "get port status, actual port %d status = 0x%x\n", wIndex, temp); | 425 | xhci_dbg(xhci, "get port status, actual port %d status = 0x%x\n", wIndex, temp); |
422 | 426 | ||
423 | /* FIXME - should we return a port status value like the USB | 427 | /* FIXME - should we return a port status value like the USB |
@@ -492,6 +496,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
492 | goto error; | 496 | goto error; |
493 | wIndex--; | 497 | wIndex--; |
494 | temp = xhci_readl(xhci, port_array[wIndex]); | 498 | temp = xhci_readl(xhci, port_array[wIndex]); |
499 | if (temp == 0xffffffff) { | ||
500 | retval = -ENODEV; | ||
501 | break; | ||
502 | } | ||
495 | temp = xhci_port_state_to_neutral(temp); | 503 | temp = xhci_port_state_to_neutral(temp); |
496 | /* FIXME: What new port features do we need to support? */ | 504 | /* FIXME: What new port features do we need to support? */ |
497 | switch (wValue) { | 505 | switch (wValue) { |
@@ -562,6 +570,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, | |||
562 | goto error; | 570 | goto error; |
563 | wIndex--; | 571 | wIndex--; |
564 | temp = xhci_readl(xhci, port_array[wIndex]); | 572 | temp = xhci_readl(xhci, port_array[wIndex]); |
573 | if (temp == 0xffffffff) { | ||
574 | retval = -ENODEV; | ||
575 | break; | ||
576 | } | ||
565 | /* FIXME: What new port features do we need to support? */ | 577 | /* FIXME: What new port features do we need to support? */ |
566 | temp = xhci_port_state_to_neutral(temp); | 578 | temp = xhci_port_state_to_neutral(temp); |
567 | switch (wValue) { | 579 | switch (wValue) { |
@@ -677,6 +689,10 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) | |||
677 | /* For each port, did anything change? If so, set that bit in buf. */ | 689 | /* For each port, did anything change? If so, set that bit in buf. */ |
678 | for (i = 0; i < ports; i++) { | 690 | for (i = 0; i < ports; i++) { |
679 | temp = xhci_readl(xhci, port_array[i]); | 691 | temp = xhci_readl(xhci, port_array[i]); |
692 | if (temp == 0xffffffff) { | ||
693 | retval = -ENODEV; | ||
694 | break; | ||
695 | } | ||
680 | if ((temp & mask) != 0 || | 696 | if ((temp & mask) != 0 || |
681 | (bus_state->port_c_suspend & 1 << i) || | 697 | (bus_state->port_c_suspend & 1 << i) || |
682 | (bus_state->resume_done[i] && time_after_eq( | 698 | (bus_state->resume_done[i] && time_after_eq( |