Skip to contentSkip to conversation

blockdbg: Fix Bottom Half deletion

PATCH New Kevin Wolf 1 participant 1 message May 27, 2011 Block layer

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

PATCH 1/1 blockdbg: Fix Bottom Half deletion

You can only delete a BH in its BH handler if you don't call a nested qemu_bh_poll afterwards (the nested one would free the BH and the outer one segfaults when returning from the BH handler).

To avoid this situation, first call the callback and only then delete the BH.

---
 block/blkdebug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
block/blkdebug.c +1 -1
index cd9eb80..45bbab8 100644
@@ -316,8 +316,8 @@ static int blkdebug_open(BlockDriverState *bs, const char *filename, int flags)
 static void error_callback_bh(void *opaque)
 {
     struct BlkdebugAIOCB *acb = opaque;
-    qemu_bh_delete(acb->bh);
     acb->common.cb(acb->common.opaque, acb->ret);
+    qemu_bh_delete(acb->bh);
     qemu_aio_release(acb);
 }
 
Signature · 1 line
1.7.2.3