[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/35] vhost-vdpa: correctly return err in vhost_vdpa_set_backend_
From: |
Michael S. Tsirkin |
Subject: |
[PULL 26/35] vhost-vdpa: correctly return err in vhost_vdpa_set_backend_cap() |
Date: |
Sat, 4 Sep 2021 17:37:14 -0400 |
From: Jason Wang <jasowang@redhat.com>
We should return error code instead of zero, otherwise there's no way
for the caller to detect the failure.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Message-Id: <20210903091031.47303-3-jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-vdpa.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index ca1227e5dc..7633ea66d1 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -443,13 +443,13 @@ static int vhost_vdpa_set_backend_cap(struct vhost_dev
*dev)
int r;
if (vhost_vdpa_call(dev, VHOST_GET_BACKEND_FEATURES, &features)) {
- return 0;
+ return -EFAULT;
}
features &= f;
r = vhost_vdpa_call(dev, VHOST_SET_BACKEND_FEATURES, &features);
if (r) {
- return 0;
+ return -EFAULT;
}
dev->backend_cap = features;
--
MST
- [PULL 16/35] hw/i386/acpi-build: Get NUMA information from struct NumaState, (continued)
- [PULL 16/35] hw/i386/acpi-build: Get NUMA information from struct NumaState, Michael S. Tsirkin, 2021/09/04
- [PULL 17/35] hw/pci: remove all references to find_i440fx function, Michael S. Tsirkin, 2021/09/04
- [PULL 20/35] hw/virtio: Document virtio_queue_packed_empty_rcu is called within RCU, Michael S. Tsirkin, 2021/09/04
- [PULL 21/35] hw/virtio: Remove NULL check in virtio_free_region_cache(), Michael S. Tsirkin, 2021/09/04
- [PULL 19/35] MAINTAINERS: Added myself as a reviewer for acpi/smbios subsystem, Michael S. Tsirkin, 2021/09/04
- [PULL 18/35] hw/acpi: use existing references to pci device struct within functions, Michael S. Tsirkin, 2021/09/04
- [PULL 22/35] hw/virtio: Add flatview update in vhost_user_cleanup(), Michael S. Tsirkin, 2021/09/04
- [PULL 23/35] tests/vhost-user-bridge.c: Sanity check socket path length, Michael S. Tsirkin, 2021/09/04
- [PULL 24/35] tests/vhost-user-bridge.c: Fix typo in help message, Michael S. Tsirkin, 2021/09/04
- [PULL 25/35] vhost-vdpa: remove unused variable "acked_features", Michael S. Tsirkin, 2021/09/04
- [PULL 26/35] vhost-vdpa: correctly return err in vhost_vdpa_set_backend_cap(),
Michael S. Tsirkin <=
- [PULL 27/35] vhost_net: remove the meaningless assignment in vhost_net_start_one(), Michael S. Tsirkin, 2021/09/04
- [PULL 28/35] vhost: use unsigned int for nvqs, Michael S. Tsirkin, 2021/09/04
- [PULL 29/35] vhost_net: do not assume nvqs is always 2, Michael S. Tsirkin, 2021/09/04
- [PULL 30/35] vhost-vdpa: remove the unnecessary check in vhost_vdpa_add(), Michael S. Tsirkin, 2021/09/04
- [PULL 31/35] vhost-vdpa: don't cleanup twice in vhost_vdpa_add(), Michael S. Tsirkin, 2021/09/04
- [PULL 33/35] vhost-vdpa: tweak the error label in vhost_vdpa_add(), Michael S. Tsirkin, 2021/09/04
- [PULL 34/35] vhost-vdpa: fix the wrong assertion in vhost_vdpa_init(), Michael S. Tsirkin, 2021/09/04
- [PULL 35/35] vhost-vdpa: remove the unncessary queue_index assignment, Michael S. Tsirkin, 2021/09/04
- [PULL 08/35] vhost-user: add missing space in error message, Michael S. Tsirkin, 2021/09/04
- [PULL 15/35] vhost: correctly detect the enabling IOMMU, Michael S. Tsirkin, 2021/09/04