aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-10-05 15:53:58 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-10-09 16:52:07 -0400
commit06bad89da686f6323e95cf925105e8cf88d87caf (patch)
tree199c128cb1792e320051a4bf8c0f1675e2a36a66 /drivers/usb/serial
parentb0a9cf297e587219332ee4acca243627702c2cc9 (diff)
USB: ipaq: fix oops when device is plugged in
This patch (as1293) fixes a problem with the ipaq serial driver. It tries to bind to all the interfaces, even those that don't have enough endpoints. The symptom is an invalid memory reference and oops when the device is plugged in. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: stable <stable@kernel.org> Tested-by: Matthias Geissert <geissert@mathematik.tu-darmstadt.de> Tested-by: Tilman Schmidt <tilman@imap.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ipaq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c
index 24fcc64b837d..d6231c38813e 100644
--- a/drivers/usb/serial/ipaq.c
+++ b/drivers/usb/serial/ipaq.c
@@ -966,6 +966,15 @@ static int ipaq_calc_num_ports(struct usb_serial *serial)
966static int ipaq_startup(struct usb_serial *serial) 966static int ipaq_startup(struct usb_serial *serial)
967{ 967{
968 dbg("%s", __func__); 968 dbg("%s", __func__);
969
970 /* Some of the devices in ipaq_id_table[] are composite, and we
971 * shouldn't bind to all the interfaces. This test will rule out
972 * some obviously invalid possibilities.
973 */
974 if (serial->num_bulk_in < serial->num_ports ||
975 serial->num_bulk_out < serial->num_ports)
976 return -ENODEV;
977
969 if (serial->dev->actconfig->desc.bConfigurationValue != 1) { 978 if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
970 /* 979 /*
971 * FIXME: HP iPaq rx3715, possibly others, have 1 config that 980 * FIXME: HP iPaq rx3715, possibly others, have 1 config that