From: Gerd Hoffmann Date: Wed, 22 May 2019 09:47:00 +0000 (+0200) Subject: usb: call reset handler before updating state X-Git-Tag: v4.1.0-rc0~80^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ed4657396add28382081a15557c78cd480c1cf1;hp=da35f7f1eeff9f249a9597400fc514c83fd3a0f8;p=thirdparty%2Fqemu.git usb: call reset handler before updating state That way the device reset handler can see what the before-reset state of the device is. Signed-off-by: Gerd Hoffmann Message-id: 20190522094702.17619-2-kraxel@redhat.com --- diff --git a/hw/usb/core.c b/hw/usb/core.c index 8fbd9c7d573..3ab48a16074 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -87,10 +87,10 @@ void usb_device_reset(USBDevice *dev) if (dev == NULL || !dev->attached) { return; } + usb_device_handle_reset(dev); dev->remote_wakeup = 0; dev->addr = 0; dev->state = USB_STATE_DEFAULT; - usb_device_handle_reset(dev); } void usb_wakeup(USBEndpoint *ep, unsigned int stream)