Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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