Skip to content

Commit 3f4c0af

Browse files
philmdstefanhaRH
authored andcommitted
util/vfio-helpers: Remove unreachable code in qemu_vfio_dma_map()
qemu_vfio_add_mapping() returns a pointer to an indexed entry in pre-allocated QEMUVFIOState::mappings[], thus can not be NULL. Remove the pointless check. Reviewed-by: Klaus Jensen <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Message-id: [email protected] Signed-off-by: Stefan Hajnoczi <[email protected]>
1 parent a990858 commit 3f4c0af

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

util/vfio-helpers.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,10 +751,6 @@ int qemu_vfio_dma_map(QEMUVFIOState *s, void *host, size_t size,
751751
}
752752

753753
mapping = qemu_vfio_add_mapping(s, host, size, index + 1, iova0);
754-
if (!mapping) {
755-
ret = -ENOMEM;
756-
goto out;
757-
}
758754
assert(qemu_vfio_verify_mappings(s));
759755
ret = qemu_vfio_do_mapping(s, host, size, iova0);
760756
if (ret) {

0 commit comments

Comments
 (0)