On Tue, 15 Jun 2004, Olivier Chapuis wrote: > On Mon, Jun 14, 2004 at 11:25:43AM -0400, Alan Stern wrote: > > On Sat, 12 Jun 2004, Olivier Chapuis wrote: > > > > > - I take a look to the 2.6 code (usb/core/config.c) and I do not > > > think that my camera will be recognized by a 2.6 kernel ... sorry > > > no patch. > > > > I would be surprised if it didn't work. Have you tried it? What do you > > think might be wrong with the code? > > > > I've not the time to install a 2.6 kernel, sorry. Any way I think it > will not work for exactly the same reasons than for the 2.4.26 kernel. > size will become negative in the find_next_descriptor function > (drivers/usb/core/config.c) going "out of descriptors parsing".
That can never happen in 2.6. All the descriptors are checked in usb_parse_configuration() before find_next_descriptor() is called. If a descriptor has bLength > size2 then that descriptor and everything following are ignored. > Then, > usb_parse_endpoint will return a too big value; in turn > usb_parse_interface will return a too big value. Then, size will > become negative in the while loop of usb_parse_configuration and this > function will return a negative value. So, the configuration is > rejected. > > Again, I am surprised to see a comparison between an int (size) > and a (possibly) unsigned int (sizeof(...)). While it's true that there is such a comparison, the context makes it clear that the int value will always be non-negative. So there's no problem. Alan Stern ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
