Commit 06bad89d authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

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: default avatarAlan Stern <stern@rowland.harvard.edu>
CC: stable <stable@kernel.org>
Tested-by: default avatarMatthias Geissert <geissert@mathematik.tu-darmstadt.de>
Tested-by: default avatarTilman Schmidt <tilman@imap.cc>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b0a9cf29
...@@ -966,6 +966,15 @@ static int ipaq_calc_num_ports(struct usb_serial *serial) ...@@ -966,6 +966,15 @@ static int ipaq_calc_num_ports(struct usb_serial *serial)
static int ipaq_startup(struct usb_serial *serial) static int ipaq_startup(struct usb_serial *serial)
{ {
dbg("%s", __func__); dbg("%s", __func__);
/* Some of the devices in ipaq_id_table[] are composite, and we
* shouldn't bind to all the interfaces. This test will rule out
* some obviously invalid possibilities.
*/
if (serial->num_bulk_in < serial->num_ports ||
serial->num_bulk_out < serial->num_ports)
return -ENODEV;
if (serial->dev->actconfig->desc.bConfigurationValue != 1) { if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
/* /*
* FIXME: HP iPaq rx3715, possibly others, have 1 config that * FIXME: HP iPaq rx3715, possibly others, have 1 config that
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment