Commit 1a0da0e5 authored by Alan Stern's avatar Alan Stern Committed by Greg Kroah-Hartman

USB: ipaq: fix oops when device is plugged in

commit 06bad89d upstream.

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>
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 3d22a3e7
......@@ -971,6 +971,15 @@ static int ipaq_calc_num_ports(struct usb_serial *serial)
static int ipaq_startup(struct usb_serial *serial)
{
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) {
/*
* 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