[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 39/51] vdpa: harden the error path if get_iova_range failed
From: |
Michael S. Tsirkin |
Subject: |
[PULL 39/51] vdpa: harden the error path if get_iova_range failed |
Date: |
Thu, 5 Jan 2023 04:16:28 -0500 |
From: Longpeng <longpeng2@huawei.com>
We should stop if the GET_IOVA_RANGE ioctl failed.
Signed-off-by: Longpeng <longpeng2@huawei.com>
Message-Id: <20221224114848.3062-3-longpeng2@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
---
net/vhost-vdpa.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index b6e1e84ed2..1a13a34d35 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -805,7 +805,13 @@ int net_init_vhost_vdpa(const Netdev *netdev, const char
*name,
return queue_pairs;
}
- vhost_vdpa_get_iova_range(vdpa_device_fd, &iova_range);
+ r = vhost_vdpa_get_iova_range(vdpa_device_fd, &iova_range);
+ if (unlikely(r < 0)) {
+ error_setg(errp, "vhost-vdpa: get iova range failed: %s",
+ strerror(-r));
+ goto err;
+ }
+
if (opts->x_svq) {
if (!vhost_vdpa_net_valid_svq_features(features, errp)) {
goto err_svq;
--
MST
- [PULL 25/51] hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device(), (continued)
- [PULL 25/51] hw/virtio: Rename virtio_device_find() -> qmp_find_virtio_device(), Michael S. Tsirkin, 2023/01/05
- [PULL 27/51] include/hw/pci: Break inclusion loop pci_bridge.h and cxl.h, Michael S. Tsirkin, 2023/01/05
- [PULL 30/51] include/hw/pci: Clean up a few things checkpatch.pl would flag, Michael S. Tsirkin, 2023/01/05
- [PULL 29/51] include/hw/cxl: Include hw/cxl/*.h where needed, Michael S. Tsirkin, 2023/01/05
- [PULL 31/51] include/hw/pci: Split pci_device.h off pci.h, Michael S. Tsirkin, 2023/01/05
- [PULL 34/51] include/hw/virtio: Break inclusion loop, Michael S. Tsirkin, 2023/01/05
- [PULL 35/51] include: Include headers where needed, Michael S. Tsirkin, 2023/01/05
- [PULL 36/51] include: Don't include qemu/osdep.h, Michael S. Tsirkin, 2023/01/05
- [PULL 37/51] docs/devel: Rules on #include in headers, Michael S. Tsirkin, 2023/01/05
- [PULL 39/51] vdpa: harden the error path if get_iova_range failed,
Michael S. Tsirkin <=
- [PULL 40/51] vhost: simplify vhost_dev_enable_notifiers, Michael S. Tsirkin, 2023/01/05
- [PULL 41/51] vhost: configure all host notifiers in a single MR transaction, Michael S. Tsirkin, 2023/01/05
- [PULL 43/51] virtio-pci: fix proxy->vector_irqfd leak in virtio_pci_set_guest_notifiers, Michael S. Tsirkin, 2023/01/05
- [PULL 38/51] vdpa-dev: get iova range explicitly, Michael S. Tsirkin, 2023/01/05
- [PULL 42/51] vdpa: commit all host notifier MRs in a single MR transaction, Michael S. Tsirkin, 2023/01/05
- [PULL 44/51] tests: virt: Allow changes to PPTT test table, Michael S. Tsirkin, 2023/01/05
- [PULL 45/51] hw/acpi/aml-build: Only generate cluster node in PPTT when specified, Michael S. Tsirkin, 2023/01/05
- [PULL 46/51] tests: virt: Update expected ACPI tables for virt test, Michael S. Tsirkin, 2023/01/05
- [PULL 47/51] tests: acpi: Add and whitelist *.topology blobs, Michael S. Tsirkin, 2023/01/05
- [PULL 48/51] tests: acpi: aarch64: Add topology test for aarch64, Michael S. Tsirkin, 2023/01/05