diff mbox series

[for-7.2,v2,3/6] hw/nvme: fix flush cancel

Message ID 20221110070523.36290-4-its@irrelevant.dk
State New
Headers show
Series hw/nvme: misc fixes | expand

Commit Message

Klaus Jensen Nov. 10, 2022, 7:05 a.m. UTC
From: Klaus Jensen <k.jensen@samsung.com>

Make sure that iocb->aiocb is NULL'ed when cancelling.

Fixes: 38f4ac65ac88 ("hw/nvme: reimplement flush to allow cancellation")
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
---
 hw/nvme/ctrl.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 819c02067191..fe748fc18a2e 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -3176,6 +3176,7 @@  static void nvme_flush_cancel(BlockAIOCB *acb)
 
     if (iocb->aiocb) {
         blk_aio_cancel_async(iocb->aiocb);
+        iocb->aiocb = NULL;
     }
 }