[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/9] util/vfio-helpers: Remove unreachable code in qemu_vfio_dma_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 5/9] util/vfio-helpers: Remove unreachable code in qemu_vfio_dma_map() |
Date: |
Tue, 24 Aug 2021 16:11:38 +0200 |
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
util/vfio-helpers.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/util/vfio-helpers.c b/util/vfio-helpers.c
index d956866b4e9..e7909222cfd 100644
--- a/util/vfio-helpers.c
+++ b/util/vfio-helpers.c
@@ -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) {
--
2.31.1
- [PATCH 2/9] block/nvme: Have nvme_create_queue_pair() report errors consistently, (continued)
- [PATCH 2/9] block/nvme: Have nvme_create_queue_pair() report errors consistently, Philippe Mathieu-Daudé, 2021/08/24
- [PATCH 3/9] util/vfio-helpers: Let qemu_vfio_verify_mappings() use error_report(), Philippe Mathieu-Daudé, 2021/08/24
- [PATCH 4/9] util/vfio-helpers: Replace qemu_mutex_lock() calls with QEMU_LOCK_GUARD, Philippe Mathieu-Daudé, 2021/08/24
- [PATCH 6/9] util/vfio-helpers: Pass Error handle to qemu_vfio_dma_map(), Philippe Mathieu-Daudé, 2021/08/24
- [PATCH 7/9] util/vfio-helpers: Have qemu_vfio_dma_map() propagate Error, Philippe Mathieu-Daudé, 2021/08/24
- [PATCH 5/9] util/vfio-helpers: Remove unreachable code in qemu_vfio_dma_map(),
Philippe Mathieu-Daudé <=
- [PATCH 8/9] util/vfio-helpers: Let qemu_vfio_do_mapping() propagate Error, Philippe Mathieu-Daudé, 2021/08/24
- [PATCH 9/9] block/nvme: Only report VFIO error on failed retry, Philippe Mathieu-Daudé, 2021/08/24