https://bugzilla.redhat.com/show_bug.cgi?id=1743098 There is missing check for vdev in this procedure. QEMU crash happens in it in hot unplug flow.
Signed-off-by: Yuri Benditovich <yuri.benditov...@daynix.com> --- hw/virtio/virtio-pci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 094c36aa3e..2f19301267 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1364,7 +1364,13 @@ static uint64_t virtio_pci_isr_read(void *opaque, hwaddr addr, { VirtIOPCIProxy *proxy = opaque; VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); - uint64_t val = qatomic_xchg(&vdev->isr, 0); + uint64_t val = 0; + + if (vdev == NULL) { + return val; + } + + val = qatomic_xchg(&vdev->isr, 0); pci_irq_deassert(&proxy->pci_dev); return val; -- 2.17.1