USB: ftdi_sio: fix endianess of max packet size
authorMichael Wileczka <mikewileczka@yahoo.com>
Wed, 18 Aug 2010 14:14:37 +0000 (07:14 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Aug 2010 03:50:15 +0000 (20:50 -0700)
The USB max packet size (always little-endian) was not being byte
swapped on big-endian systems.

Applicable since [USB: ftdi_sio: fix hi-speed device packet size calculation] approx 2.6.31

Signed-off-by: Michael Wileczka <mikewileczka@yahoo.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/ftdi_sio.c

index eb12d9b096b4f54f803b9ee34e9302e694a799b8..e04a41613fbf9bd18dd289a5c3ffaa06dfd138a7 100644 (file)
@@ -1376,7 +1376,7 @@ static void ftdi_set_max_packet_size(struct usb_serial_port *port)
        }
 
        /* set max packet size based on descriptor */
-       priv->max_packet_size = ep_desc->wMaxPacketSize;
+       priv->max_packet_size = le16_to_cpu(ep_desc->wMaxPacketSize);
 
        dev_info(&udev->dev, "Setting MaxPacketSize %d\n", priv->max_packet_size);
 }