Skip to contentSkip to conversation

blkdebug: Delete BH in bdrv_aio_cancel

PATCH Applied Fam Zheng 2 participants 2 messages Aug 22, 2014 Block layer

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 blkdebug: Delete BH in bdrv_aio_cancel

Otherwise error_callback_bh will access the already released acb.

---
 block/blkdebug.c | 4 ++++
 1 file changed, 4 insertions(+)
block/blkdebug.c +4 -0
index 1586ed9..dac7666 100644
@@ -449,6 +449,10 @@ static void error_callback_bh(void *opaque)
 static void blkdebug_aio_cancel(BlockDriverAIOCB *blockacb)
 {
     BlkdebugAIOCB *acb = container_of(blockacb, BlkdebugAIOCB, common);
+    if (acb->bh) {
+        qemu_bh_delete(acb->bh);
+        acb->bh = NULL;
+    }
     qemu_aio_release(acb);
 }
 
Signature · 1 line
2.0.3