diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-05-27 19:05:15 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-06-23 11:28:06 +0200 |
commit | fa19bf831b8c87006533645ece58bc620aca00bc (patch) | |
tree | 7ecadccde072893726196e65ae9069925b01d962 /hw/usb-msd.c | |
parent | ee210d6390761bb0fd6febe0fb8f94ee0dcba0db (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.c | 5 |
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); } |