]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
dma-helpers: Initialize DMAAIOCB in_cancel flag
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 28 Mar 2014 14:22:49 +0000 (14:22 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Apr 2014 17:36:39 +0000 (19:36 +0200)
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

index c9620a5bbd52ee8211b5f0faa8ab35690a60910d..5f421e9814508c98c6d66518bb115ad4f6ea8286 100644 (file)
@@ -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);