mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
dde_linux/usb/legacy: only free completed URBs
In case a USB client cancelled URBs, do not free them, wait until the packets/URBs are acked by the USB session. issue #4557
This commit is contained in:
parent
87aa456bfd
commit
96b147b63d
@ -112,7 +112,6 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void usb_free_urb(struct urb *urb)
|
||||
{
|
||||
if (!urb)
|
||||
@ -121,6 +120,10 @@ void usb_free_urb(struct urb *urb)
|
||||
/* free 'Urb' object */
|
||||
if (urb->hcpriv) {
|
||||
Urb *u = (Urb*)urb->hcpriv;
|
||||
|
||||
/* URB is not fred through packet stream */
|
||||
if (u->completed() == false) return;
|
||||
|
||||
u->~Urb();
|
||||
kfree(urb->hcpriv);
|
||||
}
|
||||
|
@ -139,10 +139,12 @@ class Urb : public Usb::Completion
|
||||
}
|
||||
}
|
||||
|
||||
if (_urb.complete) _urb.complete(&_urb);
|
||||
|
||||
_completed = true;
|
||||
|
||||
if (_urb.complete) _urb.complete(&_urb);
|
||||
}
|
||||
|
||||
bool completed() const { return _completed; }
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user