diff mbox series

[PULL,2/9] aio-posix: remove confusing QLIST_SAFE_REMOVE()

Message ID 20200311124045.277969-3-stefanha@redhat.com (mailing list archive)
State New, archived
Headers show
Series [PULL,1/9] qemu/queue.h: clear linked list pointers on remove | expand

Commit Message

Stefan Hajnoczi March 11, 2020, 12:40 p.m. UTC
QLIST_SAFE_REMOVE() is confusing here because the node must be on the
list.  We actually just wanted to clear the linked list pointers when
removing it from the list.  QLIST_REMOVE() now does this, so switch to
it.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20200224103406.1894923-3-stefanha@redhat.com
Message-Id: <20200224103406.1894923-3-stefanha@redhat.com>
---
 util/aio-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/util/aio-posix.c b/util/aio-posix.c
index 9e1befc0c0..b339aab12c 100644
--- a/util/aio-posix.c
+++ b/util/aio-posix.c
@@ -493,7 +493,7 @@  static bool aio_dispatch_ready_handlers(AioContext *ctx,
     AioHandler *node;
 
     while ((node = QLIST_FIRST(ready_list))) {
-        QLIST_SAFE_REMOVE(node, node_ready);
+        QLIST_REMOVE(node, node_ready);
         progress = aio_dispatch_handler(ctx, node) || progress;
     }