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>
This commit is contained in:
Markus Armbruster 2009-10-07 01:15:57 +02:00 committed by Anthony Liguori
parent 18cfeb52d1
commit 33e66b86d8
5 changed files with 12 additions and 6 deletions

View file

@ -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;
}