USB: keyspan: fix bogus array index
authorJohan Hovold <jhovold@gmail.com>
Tue, 4 Jun 2013 16:50:29 +0000 (18:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2013 17:17:09 +0000 (10:17 -0700)
The outcont_endpoints array was indexed using the port minor number
(which can be greater than the array size) rather than the device port
number.

Cc: stable@vger.kernel.org
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/keyspan.c

index eb30d7b01f3681bd00c7fe73827533a613f162b6..d85a3e03749019a9ee5c66ecc863534c9c6ca7d2 100644 (file)
@@ -1559,7 +1559,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial,
        d_details = s_priv->device_details;
        device_port = port->number - port->serial->minor;
 
-       outcont_urb = d_details->outcont_endpoints[port->number];
+       outcont_urb = d_details->outcont_endpoints[device_port];
        this_urb = p_priv->outcont_urb;
 
        dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe));