On Tue, May 13, 2014 at 10:44:45AM +0200, Gerd Hoffmann wrote: > 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.
And SETUP_STATE_PARAM? > 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 >