* [PATCH] USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails
@ 2016-07-12 5:50 Michał Pecio
0 siblings, 0 replies; only message in thread
From: Michał Pecio @ 2016-07-12 5:50 UTC (permalink / raw)
To: stable
commit c66f59ee5050447b3da92d36f5385a847990a894 upstream.
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>
---
Hi,
This commit had been submitted to 4.7 without cc:stable because
it wasn't decided at the time whether we want this fix in stable.
It turned out we want it in 3.18 and later so I'm sending it here.
Regards,
MP
drivers/usb/host/ohci-q.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/host/ohci-q.c b/drivers/usb/host/ohci-q.c
index d029bbe..641fed6 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;
}
--
2.8.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-07-12 5:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 5:50 [PATCH] USB: OHCI: Don't mark EDs as ED_OPER if scheduling fails Michał Pecio
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).