aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-msd.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-05-27 19:05:15 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-06-23 11:28:06 +0200
commitfa19bf831b8c87006533645ece58bc620aca00bc (patch)
tree7ecadccde072893726196e65ae9069925b01d962 /hw/usb-msd.c
parentee210d6390761bb0fd6febe0fb8f94ee0dcba0db (diff)
usb: Proper error propagation for usb_device_attach errors
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-msd.c')
-rw-r--r--hw/usb-msd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index c59797b27e..a75948b286 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -497,8 +497,9 @@ static void usb_msd_password_cb(void *opaque, int err)
MSDState *s = opaque;
if (!err)
- usb_device_attach(&s->dev);
- else
+ err = usb_device_attach(&s->dev);
+
+ if (err)
qdev_unplug(&s->dev.qdev);
}