[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] usb: fix up post load checks
From: |
Gerd Hoffmann |
Subject: |
Re: [Qemu-devel] [PATCH] usb: fix up post load checks |
Date: |
Tue, 13 May 2014 10:44:45 +0200 |
On Di, 2014-05-13 at 11:32 +0300, Michael S. Tsirkin wrote:
> On Tue, May 13, 2014 at 09:50:09AM +0200, Gerd Hoffmann wrote:
> > Hi,
> >
> > > + (dev->setup_state == SETUP_STATE_DATA &&
> >
> > Fails to build, SETUP_STATE_DATA is not defined here.
> >
> > I think we can simply drop that check, index should never ever be larger
> > than len, no matter what the state is.
> >
> > cheers,
> > Gerd
>
> I'm confused by usb_generic_async_ctrl_complete which can modify len
> without touching index.
only in setup state, before any data from/to the buffer is transfered,
so index is still zero at that point.
flow is this:
state_setup: len = $buflen, index = 0
state_data: xfer %buf data, increase index up to len while doing so.
state_ack: index == len
state_idle: likewise.
cheers,
Gerd
Re: [Qemu-devel] [PATCH] usb: fix up post load checks, Michael S. Tsirkin, 2014/05/14