Skip to content

Commit 06bad89

Browse files
AlanSterngregkh
authored andcommitted
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 <[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]>
1 parent b0a9cf2 commit 06bad89

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/usb/serial/ipaq.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,15 @@ static int ipaq_calc_num_ports(struct usb_serial *serial)
966966
static int ipaq_startup(struct usb_serial *serial)
967967
{
968968
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+
969978
if (serial->dev->actconfig->desc.bConfigurationValue != 1) {
970979
/*
971980
* FIXME: HP iPaq rx3715, possibly others, have 1 config that

0 commit comments

Comments
 (0)