diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2009-08-28 17:28:15 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-09-23 09:46:18 -0400 |
commit | 204970a4bb2f584afc430ae330cd44aee329cea4 (patch) | |
tree | 4edca9077482c46c57b95a9bd2f6cdf55708e31e /drivers/usb/host/xhci-ring.c | |
parent | 99eb32db45061443ab7552b8fdceae68b90fde55 (diff) |
USB: xhci: Check URB_SHORT_NOT_OK before setting short packet status.
Make sure that the driver that submitted the URB considers a short packet
an error before setting -EREMOTEIO during a short control transfer.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index b4fab00105d4..d264f9a6c559 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -991,7 +991,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
991 | break; | 991 | break; |
992 | case COMP_SHORT_TX: | 992 | case COMP_SHORT_TX: |
993 | xhci_warn(xhci, "WARN: short transfer on control ep\n"); | 993 | xhci_warn(xhci, "WARN: short transfer on control ep\n"); |
994 | status = -EREMOTEIO; | 994 | if (td->urb->transfer_flags & URB_SHORT_NOT_OK) |
995 | status = -EREMOTEIO; | ||
996 | else | ||
997 | status = 0; | ||
995 | break; | 998 | break; |
996 | case COMP_BABBLE: | 999 | case COMP_BABBLE: |
997 | /* The 0.96 spec says a babbling control endpoint | 1000 | /* The 0.96 spec says a babbling control endpoint |
@@ -1034,7 +1037,10 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
1034 | if (event_trb == td->last_trb) { | 1037 | if (event_trb == td->last_trb) { |
1035 | if (td->urb->actual_length != 0) { | 1038 | if (td->urb->actual_length != 0) { |
1036 | /* Don't overwrite a previously set error code */ | 1039 | /* Don't overwrite a previously set error code */ |
1037 | if (status == -EINPROGRESS || status == 0) | 1040 | if ((status == -EINPROGRESS || |
1041 | status == 0) && | ||
1042 | (td->urb->transfer_flags | ||
1043 | & URB_SHORT_NOT_OK)) | ||
1038 | /* Did we already see a short data stage? */ | 1044 | /* Did we already see a short data stage? */ |
1039 | status = -EREMOTEIO; | 1045 | status = -EREMOTEIO; |
1040 | } else { | 1046 | } else { |