Skip to content

Commit

Permalink
USB: ipaq: fix oops when device is plugged in
Browse files Browse the repository at this point in the history
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 <[email protected]>
CC: stable <[email protected]>
Tested-by: Matthias Geissert <[email protected]>
Tested-by: Tilman Schmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
AlanStern authored and gregkh committed Oct 9, 2009
1 parent b0a9cf2 commit 06bad89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/usb/serial/ipaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,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
Expand Down

0 comments on commit 06bad89

Please sign in to comment.