aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichaƂ Pecio <michal.pecio@gmail.com>2016-06-07 06:34:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-06-08 01:15:25 -0400
commitc66f59ee5050447b3da92d36f5385a847990a894 (patch)
treef2c31d3fd017c24398a1e9db589a05373342fe85
parent7b2c17f829545df27a910e8d82e133c21c9a8c9c (diff)
USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails
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>
-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 d029bbe9eb36..641fed609911 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)
183{ 183{
184 int branch; 184 int branch;
185 185
186 ed->state = ED_OPER;
187 ed->ed_prev = NULL; 186 ed->ed_prev = NULL;
188 ed->ed_next = NULL; 187 ed->ed_next = NULL;
189 ed->hwNextED = 0; 188 ed->hwNextED = 0;
@@ -259,6 +258,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
259 /* the HC may not see the schedule updates yet, but if it does 258 /* the HC may not see the schedule updates yet, but if it does
260 * then they'll be properly ordered. 259 * then they'll be properly ordered.
261 */ 260 */
261
262 ed->state = ED_OPER;
262 return 0; 263 return 0;
263} 264}
264 265