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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
99eb32db45
commit
204970a4bb
@@ -991,7 +991,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
|
|||||||
break;
|
break;
|
||||||
case COMP_SHORT_TX:
|
case COMP_SHORT_TX:
|
||||||
xhci_warn(xhci, "WARN: short transfer on control ep\n");
|
xhci_warn(xhci, "WARN: short transfer on control ep\n");
|
||||||
|
if (td->urb->transfer_flags & URB_SHORT_NOT_OK)
|
||||||
status = -EREMOTEIO;
|
status = -EREMOTEIO;
|
||||||
|
else
|
||||||
|
status = 0;
|
||||||
break;
|
break;
|
||||||
case COMP_BABBLE:
|
case COMP_BABBLE:
|
||||||
/* The 0.96 spec says a babbling control endpoint
|
/* The 0.96 spec says a babbling control endpoint
|
||||||
@@ -1034,7 +1037,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
|
|||||||
if (event_trb == td->last_trb) {
|
if (event_trb == td->last_trb) {
|
||||||
if (td->urb->actual_length != 0) {
|
if (td->urb->actual_length != 0) {
|
||||||
/* Don't overwrite a previously set error code */
|
/* Don't overwrite a previously set error code */
|
||||||
if (status == -EINPROGRESS || status == 0)
|
if ((status == -EINPROGRESS ||
|
||||||
|
status == 0) &&
|
||||||
|
(td->urb->transfer_flags
|
||||||
|
& URB_SHORT_NOT_OK))
|
||||||
/* Did we already see a short data stage? */
|
/* Did we already see a short data stage? */
|
||||||
status = -EREMOTEIO;
|
status = -EREMOTEIO;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user