From: Maciej S. Szmigiero Date: Mon, 6 Nov 2023 12:53:59 +0000 (+0100) Subject: Revert "hw/virtio/virtio-pmem: Replace impossible check by assertion" X-Git-Tag: v8.2.0-rc0~30^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d7f1081864790eb1000e6ef34e202dae66a03d2;p=thirdparty%2Fqemu.git Revert "hw/virtio/virtio-pmem: Replace impossible check by assertion" This reverts commit 5960f254dbb46f0c7a9f5f44bf4d27c19c34cb97 since the previous commit made this situation possible again. Signed-off-by: Maciej S. Szmigiero --- diff --git a/hw/virtio/virtio-pmem.c b/hw/virtio/virtio-pmem.c index cc24812d2e9..c3512c2dae3 100644 --- a/hw/virtio/virtio-pmem.c +++ b/hw/virtio/virtio-pmem.c @@ -147,7 +147,10 @@ static void virtio_pmem_fill_device_info(const VirtIOPMEM *pmem, static MemoryRegion *virtio_pmem_get_memory_region(VirtIOPMEM *pmem, Error **errp) { - assert(pmem->memdev); + if (!pmem->memdev) { + error_setg(errp, "'%s' property must be set", VIRTIO_PMEM_MEMDEV_PROP); + return NULL; + } return &pmem->memdev->mr; }