From cbf95a0b117461473f05ab3cce4d01ba2b29e60a Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Fri, 22 Aug 2014 12:45:50 +0800 Subject: [PATCH] blkdebug: Delete BH in bdrv_aio_cancel Otherwise error_callback_bh will access the already released acb. Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng Signed-off-by: Kevin Wolf --- block/blkdebug.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/blkdebug.c b/block/blkdebug.c index 95b72445a7..69b330eced 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -453,6 +453,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); }