Skip to content

Commit

Permalink
USB: ftdi_sio: fix latency-timeout endianess bug
Browse files Browse the repository at this point in the history
Also fixes DMA transfer to stack for latency buffer.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 4357369 commit 54f328d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,22 +1181,28 @@ static int read_latency_timer(struct usb_serial_port *port)
{
struct ftdi_private *priv = usb_get_serial_port_data(port);
struct usb_device *udev = port->serial->dev;
unsigned short latency = 0;
unsigned char *buf;
int rv = 0;

dbg("%s", __func__);

buf = kmalloc(1, GFP_KERNEL);
if (!buf)
return -ENOMEM;

rv = usb_control_msg(udev,
usb_rcvctrlpipe(udev, 0),
FTDI_SIO_GET_LATENCY_TIMER_REQUEST,
FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE,
0, priv->interface,
(char *) &latency, 1, WDR_TIMEOUT);

buf, 1, WDR_TIMEOUT);
if (rv < 0)
dev_err(&port->dev, "Unable to read latency timer: %i\n", rv);
else
priv->latency = latency;
priv->latency = buf[0];

kfree(buf);

return rv;
}

Expand Down

0 comments on commit 54f328d

Please sign in to comment.