diff mbox

[PULL,08/10] dma-helpers: Initialize DMAAIOCB in_cancel flag

Message ID 1396639669-24348-9-git-send-email-kwolf@redhat.com
State New
Headers show

Commit Message

Kevin Wolf April 4, 2014, 7:27 p.m. UTC
From: Peter Maydell <peter.maydell@linaro.org>

Initialize the dbs->in_cancel flag in dma_bdrv_io(), since qemu_aio_get()
does not return zero-initialized memory. Spotted by the clang sanitizer
(which complained when the value loaded in dma_complete() was not valid
for a bool type); this might have resulted in leaking the AIO block.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 dma-helpers.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/dma-helpers.c b/dma-helpers.c
index c9620a5..5f421e9 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -213,6 +213,7 @@  BlockDriverAIOCB *dma_bdrv_io(
     dbs->sg_cur_index = 0;
     dbs->sg_cur_byte = 0;
     dbs->dir = dir;
+    dbs->in_cancel = false;
     dbs->io_func = io_func;
     dbs->bh = NULL;
     qemu_iovec_init(&dbs->iov, sg->nsg);