Skip to content

Commit

Permalink
dma-helpers: Initialize DMAAIOCB in_cancel flag
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
pm215 authored and kevmw committed Apr 4, 2014
1 parent f187743 commit 4d1cb6e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dma-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4d1cb6e

Please sign in to comment.