uhci: fix uhci_async_cancel_all
We update the QTAILQ in the loop, thus we must use the SAFE version to make sure we don't touch the queue struct after freeing it. https://bugzilla.novell.com/show_bug.cgi?id=766310 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
a229c0535b
commit
77fa9aee38
|
@ -292,10 +292,10 @@ static void uhci_async_cancel_device(UHCIState *s, USBDevice *dev)
|
||||||
|
|
||||||
static void uhci_async_cancel_all(UHCIState *s)
|
static void uhci_async_cancel_all(UHCIState *s)
|
||||||
{
|
{
|
||||||
UHCIQueue *queue;
|
UHCIQueue *queue, *nq;
|
||||||
UHCIAsync *curr, *n;
|
UHCIAsync *curr, *n;
|
||||||
|
|
||||||
QTAILQ_FOREACH(queue, &s->queues, next) {
|
QTAILQ_FOREACH_SAFE(queue, &s->queues, next, nq) {
|
||||||
QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) {
|
QTAILQ_FOREACH_SAFE(curr, &queue->asyncs, next, n) {
|
||||||
uhci_async_unlink(curr);
|
uhci_async_unlink(curr);
|
||||||
uhci_async_cancel(curr);
|
uhci_async_cancel(curr);
|
||||||
|
|
Loading…
Reference in a new issue