[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v4 46/48] hw: virtio-pmem: detach the element fromt the virtqueue
From: |
Michael S. Tsirkin |
Subject: |
[PULL v4 46/48] hw: virtio-pmem: detach the element fromt the virtqueue when error occurs |
Date: |
Tue, 29 Sep 2020 03:23:06 -0400 |
From: Li Qiang <liq3ea@163.com>
If error occurs while processing the virtio request we should call
'virtqueue_detach_element' to detach the element from the virtqueue
before free the elem.
Signed-off-by: Li Qiang <liq3ea@163.com>
Message-Id: <20200813165125.59928-1-liq3ea@163.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fixes: 5f503cd9f3 ("virtio-pmem: add virtio device")
Reviewed-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
---
hw/virtio/virtio-pmem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c
index 1e0c137497..ddb0125901 100644
--- a/hw/virtio/virtio-pmem.c
+++ b/hw/virtio/virtio-pmem.c
@@ -77,6 +77,7 @@ static void virtio_pmem_flush(VirtIODevice *vdev, VirtQueue
*vq)
if (req_data->elem.out_num < 1 || req_data->elem.in_num < 1) {
virtio_error(vdev, "virtio-pmem request not proper");
+ virtqueue_detach_element(vq, (VirtQueueElement *)req_data, 0);
g_free(req_data);
return;
}
--
MST
- [PULL v4 33/48] qemu-options: document SMBIOS type 11 settings, (continued)
- [PULL v4 33/48] qemu-options: document SMBIOS type 11 settings, Michael S. Tsirkin, 2020/09/29
- [PULL v4 39/48] i440fx/acpi: do not add hotplug related amls for cold plugged bridges, Michael S. Tsirkin, 2020/09/29
- [PULL v4 36/48] tests/acpi: add new unit test to test hotplug off/on feature on the root pci bus, Michael S. Tsirkin, 2020/09/29
- [PULL v4 38/48] Fix a gap where acpi_pcihp_find_hotplug_bus() returns a non-hotpluggable bus, Michael S. Tsirkin, 2020/09/29
- [PULL v4 40/48] tests/acpi: list added acpi table binary file for pci bridge hotplug test, Michael S. Tsirkin, 2020/09/29
- [PULL v4 37/48] tests/acpi: add a new ACPI table in order to test root pci hotplug on/off, Michael S. Tsirkin, 2020/09/29
- [PULL v4 41/48] tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag, Michael S. Tsirkin, 2020/09/29
- [PULL v4 42/48] tests/acpi: add newly added acpi DSDT table blob for pci bridge hotplug flag, Michael S. Tsirkin, 2020/09/29
- [PULL v4 44/48] piix4: don't reserve hw resources when hotplug is off globally, Michael S. Tsirkin, 2020/09/29
- [PULL v4 43/48] Add ACPI DSDT tables for q35 that are being updated by the next patch, Michael S. Tsirkin, 2020/09/29
- [PULL v4 46/48] hw: virtio-pmem: detach the element fromt the virtqueue when error occurs,
Michael S. Tsirkin <=
- [PULL v4 48/48] libvhost-user: return on error in vu_log_queue_fill(), Michael S. Tsirkin, 2020/09/29
- [PULL v4 12/48] virtio-pmem-pci: force virtio version 1, Michael S. Tsirkin, 2020/09/29
- [PULL v4 01/48] linux headers: sync to 5.9-rc4, Michael S. Tsirkin, 2020/09/29
- [PULL v4 23/48] x86: cpuhp: refuse cpu hot-unplug request earlier if not supported, Michael S. Tsirkin, 2020/09/29
- [PULL v4 30/48] tests: acpi: update acpi blobs with new AML, Michael S. Tsirkin, 2020/09/29
- [PULL v4 20/48] virtio: update MemoryRegionCaches when guest set bad features, Michael S. Tsirkin, 2020/09/29
- [PULL v4 02/48] vhost: switch to use IOTLB v2 format, Michael S. Tsirkin, 2020/09/29
- [PULL v4 47/48] libvhost-user: return early on virtqueue errors, Michael S. Tsirkin, 2020/09/29
- [PULL v4 45/48] tests/acpi: update golden master DSDT binary table blobs for q35, Michael S. Tsirkin, 2020/09/29
- Re: [PULL v4 00/48] virtio,pc,acpi: fixes, tests, no-reply, 2020/09/29