提交 c66f59ee 编写于 作者: M Michał Pecio 提交者: Greg Kroah-Hartman

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: NMichal Pecio <michal.pecio@gmail.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 7b2c17f8
...@@ -183,7 +183,6 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) ...@@ -183,7 +183,6 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed)
{ {
int branch; int branch;
ed->state = ED_OPER;
ed->ed_prev = NULL; ed->ed_prev = NULL;
ed->ed_next = NULL; ed->ed_next = NULL;
ed->hwNextED = 0; ed->hwNextED = 0;
...@@ -259,6 +258,8 @@ static int ed_schedule (struct ohci_hcd *ohci, struct ed *ed) ...@@ -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 /* the HC may not see the schedule updates yet, but if it does
* then they'll be properly ordered. * then they'll be properly ordered.
*/ */
ed->state = ED_OPER;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册