]> git.proxmox.com Git - qemu.git/commit
usb-storage: fix request canceling
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 18 Apr 2012 10:08:29 +0000 (12:08 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Thu, 26 Apr 2012 10:21:16 +0000 (12:21 +0200)
commit6d7aeeeb8985634a2015e804045a1ca52573ccc5
tree37a839e19ab8af7dd3b7c7e4cd6dd6b49573ed99
parent8a771f77e2abfb81f1f33a986810c16ecae54ca7
usb-storage: fix request canceling

Little fix for usb packet handling on i/o cancelation.  The
usb packet pointer (s->packet) is cleared at the wrong place:
The scsi request cancel handler does it.  When a usb packet
is canceled the usb-storage emulation canceles the scsi request
if present.  In most cases there is one, so usually s->packet
is cleared as needed even with the code sitting at the wrong
place.

If there is no scsi request in flight s->packet is not cleared
though.  The usb-storage emulation will then try to complete an
usb packet which is not in flight any more and thereby trigger
an assert() in the usb core.

Fix this by clearing s->packet at the correct place, which is
the usb packet cancel header.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/dev-storage.c