[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/10] vhost: also check queue state in the vhost_dev_set_log erro
From: |
Michael S. Tsirkin |
Subject: |
[PULL 09/10] vhost: also check queue state in the vhost_dev_set_log error routine |
Date: |
Thu, 16 Jun 2022 12:57:48 -0400 |
From: Ni Xun <richardni@tencent.com>
When check queue state in the vhost_dev_set_log routine, it miss the error
routine check, this patch also check queue state in error case.
Fixes: 1e5a050f5798 ("check queue state in the vhost_dev_set_log routine")
Signed-off-by: Ni Xun <richardni@tencent.com>
Reviewed-by: Zhigang Lu <tonnylu@tencent.com>
Message-Id:
<OS0PR01MB57139163F3F3955960675B52EAA79@OS0PR01MB5713.jpnprd01.prod.outlook.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index dd3263df56..6c41fa13e3 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -886,6 +886,10 @@ static int vhost_dev_set_log(struct vhost_dev *dev, bool
enable_log)
err_vq:
for (; i >= 0; --i) {
idx = dev->vhost_ops->vhost_get_vq_index(dev, dev->vq_index + i);
+ addr = virtio_queue_get_desc_addr(dev->vdev, idx);
+ if (!addr) {
+ continue;
+ }
vhost_virtqueue_set_addr(dev, dev->vqs + i, idx,
dev->log_enabled);
}
--
MST
- [PULL 00/10] virtio,pc,pci: fixes,cleanups,features, Michael S. Tsirkin, 2022/06/16
- [PULL 01/10] pci-bridge/cxl_upstream: Add a CXL switch upstream port, Michael S. Tsirkin, 2022/06/16
- [PULL 02/10] pci-bridge/cxl_downstream: Add a CXL switch downstream port, Michael S. Tsirkin, 2022/06/16
- [PULL 03/10] docs/cxl: Add switch documentation, Michael S. Tsirkin, 2022/06/16
- [PULL 04/10] virtio/vhost-user: Fix wrong vhost notifier GPtrArray size, Michael S. Tsirkin, 2022/06/16
- [PULL 06/10] virtio-iommu: Use recursive lock to avoid deadlock, Michael S. Tsirkin, 2022/06/16
- [PULL 05/10] virtio-iommu: Add bypass mode support to assigned device, Michael S. Tsirkin, 2022/06/16
- [PULL 07/10] virtio-iommu: Add an assert check in translate routine, Michael S. Tsirkin, 2022/06/16
- [PULL 10/10] acpi/erst: fix fallthrough code upon validation failure, Michael S. Tsirkin, 2022/06/16
- [PULL 09/10] vhost: also check queue state in the vhost_dev_set_log error routine,
Michael S. Tsirkin <=
- [PULL 08/10] crypto: Introduce RSA algorithm, Michael S. Tsirkin, 2022/06/16
- Re: [PULL 00/10] virtio,pc,pci: fixes,cleanups,features, Richard Henderson, 2022/06/16