aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-hotplug.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2009-10-07 01:15:57 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-07 08:54:54 -0500
commit33e66b86d89040f0a9e99aa53deb74ce8936a649 (patch)
treea356cfe20774dbc9e6107d8824414c1ea75599ce /hw/pci-hotplug.c
parent18cfeb52d17825dddadfc74e99255530aa889136 (diff)
Check return value of qdev_init()
But do so only where it may actually fail. Leave the rest for the next commit. Patchworks-ID: 35167 Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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 c38a127394..ccd2cf3cac 100644
--- a/hw/pci-hotplug.c
+++ b/hw/pci-hotplug.c
@@ -172,8 +172,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;
}