mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-27 05:20:50 +00:00
dma: the passed io_func does not return NULL
Initially found with the following semantic patch: @ type @ BlockDriverAIOCB *x; expression E; @@ x = E; - if (x == NULL) { ... } @ acb1 @ expression E, E1; @@ E1->acb = E; - if (E1->acb == NULL) { ... } @ aiocb1 @ expression E, E1; @@ E1->aiocb = E; - if (E1->aiocb == NULL) { ... } @ acb @ expression E, E1; @@ E1.acb = E; - if (E1.acb == NULL) { ... } @ aiocb @ expression E, E1; @@ E1.aiocb = E; - if (E1.aiocb == NULL) { ... } but changed manually to include an assert. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
91977c2e5f
commit
6bee44ea34
@ -142,9 +142,7 @@ static void dma_bdrv_cb(void *opaque, int ret)
|
|||||||
|
|
||||||
dbs->acb = dbs->io_func(dbs->bs, dbs->sector_num, &dbs->iov,
|
dbs->acb = dbs->io_func(dbs->bs, dbs->sector_num, &dbs->iov,
|
||||||
dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
dbs->iov.size / 512, dma_bdrv_cb, dbs);
|
||||||
if (!dbs->acb) {
|
assert(dbs->acb);
|
||||||
dma_complete(dbs, -EIO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_aio_cancel(BlockDriverAIOCB *acb)
|
static void dma_aio_cancel(BlockDriverAIOCB *acb)
|
||||||
|
Loading…
Reference in New Issue
Block a user