summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pci-hotplug.c')
-rw-r--r--hw/pci-hotplug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c
index ef818219f..b7cdbcc20 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -173,8 +173,8 @@ static PCIDevice *qemu_pci_hot_add_storage(Monitor *mon,
default:
dev = NULL;
}
- if (dev)
- qdev_init(&dev->qdev);
+ if (!dev || qdev_init(&dev->qdev) < 0)
+ return NULL;
return dev;
}