mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
usb/storage: clear csw on reset
Stale data in csw (specifically residue) can confuse the state machine and allows the guest trigger an assert(). So clear csw on reset to avoid this happening in case the guest resets the device in the middle of a request. Buglink: https://bugs.launchpad.net/qemu/+bug/1523811 Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210312094954.796799-1-kraxel@redhat.com>
This commit is contained in:
parent
f98c9bd45f
commit
39912c14da
1 changed files with 1 additions and 0 deletions
|
@ -313,6 +313,7 @@ void usb_msd_handle_reset(USBDevice *dev)
|
|||
usb_msd_packet_complete(s);
|
||||
}
|
||||
|
||||
memset(&s->csw, 0, sizeof(s->csw));
|
||||
s->mode = USB_MSDM_CBW;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue