aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-msd.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/usb-msd.c
parent18cfeb52d17825dddadfc74e99255530aa889136 (diff)
downloadqemu-33e66b86d89040f0a9e99aa53deb74ce8936a649.zip
qemu-33e66b86d89040f0a9e99aa53deb74ce8936a649.tar.gz
qemu-33e66b86d89040f0a9e99aa53deb74ce8936a649.tar.bz2
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/usb-msd.c')
-rw-r--r--hw/usb-msd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index e090014..dd3010e 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -571,7 +571,8 @@ USBDevice *usb_msd_init(const char *filename)
/* create guest device */
dev = usb_create(NULL /* FIXME */, "QEMU USB MSD");
qdev_prop_set_drive(&dev->qdev, "drive", dinfo);
- qdev_init(&dev->qdev);
+ if (qdev_init(&dev->qdev) < 0)
+ return NULL;
return dev;
}