linux/drivers/usb/core
Alan Stern 67f5a4ba97 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 <stern@rowland.harvard.edu>
Tested-by: Guillermo Jarabo <williamjap@gmail.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

===================================================================
2009-02-27 14:40:50 -08:00
..
Kconfig
Makefile
buffer.c
config.c
devices.c
devio.c USB: fix char-device disconnect handling 2009-01-27 16:15:32 -08:00
driver.c USB: fix toggle mismatch in disable_endpoint paths 2009-01-27 16:15:32 -08:00
endpoint.c USB: utilize the bus notifiers 2009-01-07 10:00:08 -08:00
file.c USB: remove err() macro from usb core code 2008-10-17 14:41:11 -07:00
generic.c USB: Enhance usage of pm_message_t 2009-01-07 10:00:03 -08:00
hcd-pci.c USB/PCI: Fix resume breakage of controllers behind cardbus bridges 2009-02-17 16:56:31 -08:00
hcd.c USB: mark "reject" field of struct urb as atomic_t 2009-01-07 10:00:08 -08:00
hcd.h USB/PCI: Fix resume breakage of controllers behind cardbus bridges 2009-02-17 16:56:31 -08:00
hub.c USB: fix toggle mismatch in disable_endpoint paths 2009-01-27 16:15:32 -08:00
hub.h
inode.c USB: fix char-device disconnect handling 2009-01-27 16:15:32 -08:00
message.c USB: usb_get_string should check the descriptor type 2009-02-27 14:40:50 -08:00
notify.c
otg_whitelist.h
quirks.c
sysfs.c USB: utilize the bus notifiers 2009-01-07 10:00:08 -08:00
urb.c USB: extension of anchor API to unpoison an anchor 2009-01-07 10:00:11 -08:00
usb.c USB: re-enable interface after driver unbinds 2009-01-07 10:00:13 -08:00
usb.h USB: fix char-device disconnect handling 2009-01-27 16:15:32 -08:00