aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-msd.c
diff options
context:
space:
mode:
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 e090014f74..dd3010e006 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;
}