]> git.hungrycats.org Git - linux/commitdiff
USB: keyspan: fix bogus array index
authorJohan Hovold <jhovold@gmail.com>
Tue, 4 Jun 2013 16:50:29 +0000 (18:50 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 19 Jun 2013 01:16:55 +0000 (02:16 +0100)
commit a07088098a650267b2eda689538133a324b9523f upstream.

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.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/serial/keyspan.c

index a442352d7b61ed59e195132c4c579680554d3ec0..4f415e28b2eb5c57228c4ddf27fb8e37b886ffe8 100644 (file)
@@ -1833,7 +1833,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;
 
        dbg("%s - endpoint %d", __func__, usb_pipeendpoint(this_urb->pipe));