On Wed, Mar 15, 2006 at 05:25:39PM -0500, Alan Stern wrote:
> On Wed, 15 Mar 2006, Marc Singer wrote:
> 
> > > Here Linux get the 9-byte header for descriptor 1.  It says wTotalLength 
> > > = 
> > > 0x09, which means there are no interface or endpoint descriptors 
> > > following.  Hence the warning message and the oops.
> > > 
> > > In other words, your gadget driver doesn't set wTotalLength for the 
> > > second 
> > > config descriptor as it should.
> > 
> > Isn't that the responsibility of the gadget itself and not the UDC?
> 
> Yes, it is.  What gadget driver were you using for your test?
> 
> > It seems that the host kernel code shouldn't OOPS when the data from
> > the device is invalid.
> 
> It shouldn't.  That's why I wrote the patch mentioned before.
> 
> > --- linux-2.6.15/drivers/usb/core/hub.c_orig    2006-03-15 
> > 13:58:48.000000000 -0800
> > +++ linux-2.6.15/drivers/usb/core/hub.c 2006-03-15 13:59:32.000000000 -0800
> > @@ -1161,6 +1161,8 @@
> >                          */
> >                         desc = &udev->config[i].intf_cache[0]
> >                                         ->altsetting->desc;
> > +                       if (!desc)
> > +                               continue;
> >                         if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
> >                                 continue;
> >                         /* COMM/2/all is CDC ACM, except 0xff is MSFT RNDIS.
> 
> Not good enough; other places have to be changed too.  The actual patch is 
> here:
> 
> http://marc.theaimsgroup.com/?l=linux-usb-devel&m=114184894500855&w=2

Ah.  I misunderstood.  Besides, the patch I wrote is wrong.  It isn't
desc that is NULL, it's udev->config[i].intf_cache[0].

I'll try your patch, but it looks like you made the same mistake I did
in assuming that it was the desc that is NULL.



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to