summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichaƂ Pecio <michal.pecio@gmail.com>2016-06-07 12:34:45 +0200
committerSasha Levin <alexander.levin@verizon.com>2016-08-19 23:08:45 -0400
commitc65b5c9c0085bab46706f35c4889dd03cf2b0c08 (patch)
tree0cfec20de72148441dd92f539cfe81b19cbce19c
parent6412c3ae6b415ca83264a2c11e24bfb63cd74629 (diff)
USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails
[ Upstream commit c66f59ee5050447b3da92d36f5385a847990a894 ] Since ed_schedule begins with marking the ED as "operational", the ED may be left in such state even if scheduling actually fails. This allows future submission attempts to smuggle this ED to the hardware behind the scheduler's back and without linking it to the ohci->eds_in_use list. The former causes bandwidth saturation and data loss on isoc endpoints, the latter crashes the kernel when attempt is made to unlink such ED from this list. Fix ed_schedule to update ED state only on successful return. Signed-off-by: Michal Pecio <michal.pecio@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
-rw-r--r--drivers/usb/host/ohci-q.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index fe1d5fc7da2d..47d2c09e4f35 100644
--- a/drivers/usb/host/ohci-q.c
+++ b/drivers/usb/host/ohci-q.c
@@ -183,7 +183,6 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
{
int branch;
- ed->state = ED_OPER;
ed->ed_prev = NULL;
ed->ed_next = NULL;
ed->hwNextED = 0;
@@ -259,6 +258,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
/* the HC may not see the schedule updates yet, but if it does
* then they'll be properly ordered.
*/
+
+ ed->state = ED_OPER;
return 0;
}