From: Alan Stern Date: Fri, 20 Feb 2009 21:33:08 +0000 (-0500) Subject: USB: usb_get_string should check the descriptor type X-Git-Tag: v2.6.29-rc7~22^2~10 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=67f5a4ba9741fcef3f4db3509ad03565d9e33af2;p=pandora-kernel.git USB: usb_get_string should check the descriptor type This patch (as1218) fixes a problem with a radio-control joystick used in the "walkera 4#3" helicopter. This device responds to the initial Get-String-Descriptor request for string 0 (which is really the list of supported languages) by sending its config descriptor! The usb_get_string() routine needs to check whether it got the right type of descriptor. Oddly enough, this sort of check is already present in usb_get_descriptor(). The patch changes the error code from -EPROTO to -ENODATA, because -EPROTO shows up in so many other contexts to indicate a hardware failure rather than a firmware error. Signed-off-by: Alan Stern Tested-by: Guillermo Jarabo Cc: stable Signed-off-by: Greg Kroah-Hartman =================================================================== --- Reading git-diff-tree failed