On Tue, 7 Jun 2016, Michał Pecio wrote: > 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@xxxxxxxxx> > --- > 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; > } Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> Greg, in principle this should go to -stable. However, it looks like this might break some applications that currently sort-of work, even though they shouldn't. Therefore we have decided not to mark this patch for -stable at present. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html