[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 71/73] hw/virtio/vhost-user: avoid using unitialized errp
From: |
Michael S. Tsirkin |
Subject: |
[PULL 71/73] hw/virtio/vhost-user: avoid using unitialized errp |
Date: |
Tue, 7 Mar 2023 20:14:22 -0500 |
From: Albert Esteve <aesteve@redhat.com>
During protocol negotiation, when we the QEMU
stub does not support a backend with F_CONFIG,
it throws a warning and supresses the
VHOST_USER_PROTOCOL_F_CONFIG bit.
However, the warning uses warn_reportf_err macro
and passes an unitialized errp pointer. However,
the macro tries to edit the 'msg' member of the
unitialized Error and segfaults.
Instead, just use warn_report, which prints a
warning message directly to the output.
Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported")
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Message-Id: <20230302121719.9390-1-aesteve@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/virtio/vhost-user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 8968541514..e5285df4ba 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -2031,8 +2031,8 @@ static int vhost_user_backend_init(struct vhost_dev *dev,
void *opaque,
} else {
if (virtio_has_feature(protocol_features,
VHOST_USER_PROTOCOL_F_CONFIG)) {
- warn_reportf_err(*errp, "vhost-user backend supports "
- "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does
not.");
+ warn_report("vhost-user backend supports "
+ "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does not.");
protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_CONFIG);
}
}
--
MST
- [PULL 60/73] pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback, (continued)
- [PULL 60/73] pcihp: add ACPI PCI hotplug specific is_hotpluggable_bus() callback, Michael S. Tsirkin, 2023/03/07
- [PULL 61/73] hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register, Michael S. Tsirkin, 2023/03/07
- [PULL 62/73] hw/pci/aer: Add missing routing for AER errors, Michael S. Tsirkin, 2023/03/07
- [PULL 63/73] hw/pci-bridge/cxl_root_port: Wire up AER, Michael S. Tsirkin, 2023/03/07
- [PULL 64/73] hw/pci-bridge/cxl_root_port: Wire up MSI, Michael S. Tsirkin, 2023/03/07
- [PULL 65/73] hw/mem/cxl-type3: Add AER extended capability, Michael S. Tsirkin, 2023/03/07
- [PULL 66/73] hw/cxl: Fix endian issues in CXL RAS capability defaults / masks, Michael S. Tsirkin, 2023/03/07
- [PULL 67/73] hw/pci/aer: Make PCIE AER error injection facility available for other emulation to use., Michael S. Tsirkin, 2023/03/07
- [PULL 68/73] hw/mem/cxl_type3: Add CXL RAS Error Injection Support., Michael S. Tsirkin, 2023/03/07
- [PULL 69/73] hw/pci: Add pcie_count_ds_port() and pcie_find_port_first() helpers, Michael S. Tsirkin, 2023/03/07
- [PULL 71/73] hw/virtio/vhost-user: avoid using unitialized errp,
Michael S. Tsirkin <=
- [PULL 70/73] hw/pxb-cxl: Support passthrough HDM Decoders unless overridden, Michael S. Tsirkin, 2023/03/07
- [PULL 72/73] virtio: fix reachable assertion due to stale value of cached region size, Michael S. Tsirkin, 2023/03/07
- [PULL 73/73] virtio: refresh vring region cache after updating a virtqueue size, Michael S. Tsirkin, 2023/03/07
- Re: [PULL 00/73] virtio,pc,pci: features, fixes, Michael S. Tsirkin, 2023/03/09
- Re: [PULL 00/73] virtio,pc,pci: features, fixes, Peter Maydell, 2023/03/10
- Re: [PULL 00/73] virtio,pc,pci: features, fixes, Philippe Mathieu-Daudé, 2023/03/10
- Re: [PULL 00/73] virtio,pc,pci: features, fixes, Michael S. Tsirkin, 2023/03/11
- Re: [PULL 00/73] virtio,pc,pci: features, fixes, Philippe Mathieu-Daudé, 2023/03/13