Skip to content
Snippets Groups Projects
Commit 3f4c0aff authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé Committed by Stefan Hajnoczi
Browse files

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: default avatarKlaus Jensen <k.jensen@samsung.com>
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20210902070025.197072-5-philmd@redhat.com
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent a990858b
No related branches found
No related tags found
No related merge requests found
......@@ -751,10 +751,6 @@ int qemu_vfio_dma_map(QEMUVFIOState *s, void *host, size_t size,
}
mapping = qemu_vfio_add_mapping(s, host, size, index + 1, iova0);
if (!mapping) {
ret = -ENOMEM;
goto out;
}
assert(qemu_vfio_verify_mappings(s));
ret = qemu_vfio_do_mapping(s, host, size, iova0);
if (ret) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment