diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-10-31 12:54:37 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-11-01 15:17:58 +0100 |
commit | 7f102ebeb5bad7b723a25557234b0feb493f6134 (patch) | |
tree | 94ba630be5be8c8f8aac432f366282ccc165502f /memory.c | |
parent | faccca000f27bb63fce0c71dc4ca68be1c23a8b0 (diff) |
uhci: Don't crash on device disconnect
My recent uhci cleanup series has introduced a regression, where
qemu sometimes crashes on a device disconnect. The problem is that
the uhci code never checked for a device not / no longer existing, instead
it was relying on usb_handle_packet accepting a NULL device.
But since we now pass usb_handle_packet q->ep->dev, rather then just
a local dev variable, we crash as q->ep == NULL due to the device no longer
existing.
This patch fixes this. Note that this patch also improves over
the old behavior were we would:
1) create a queue for the device
2) create an async for the packet
3) have usb_handle_packet fail
4) destroy the async
5) wait for the queue to be idle for 32 frames
6) destroy the queue
Which was rather sub-optimal.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'memory.c')
0 files changed, 0 insertions, 0 deletions