Re: [2.6.31-rc4] ftdi_usb maps memory from stack...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Looks like some of the functions in ftdi_sio.c call usb_control_msg with
> a stack buffer and some use a kmalloc buffer. They should likely all be
> using a kmalloc buffer.

Does this fix the issue?

	Regards
		Oliver

--

commit b144308aa6fc86397a14c6954a5eaf049ca5df37
Author: Oliver Neukum <oliver@xxxxxxxxxx>
Date:   Wed Jul 29 15:45:25 2009 +0200

    usb: fix dma on stack in ftdi_sio

diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 60c64cc..3b763ed 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1682,9 +1682,7 @@ static int ftdi_open(struct tty_struct *tty,
 	struct usb_device *dev = port->serial->dev;
 	struct ftdi_private *priv = usb_get_serial_port_data(port);
 	unsigned long flags;
-
 	int result = 0;
-	char buf[1]; /* Needed for the usb_control_msg I think */
 
 	dbg("%s", __func__);
 
@@ -1705,7 +1703,7 @@ static int ftdi_open(struct tty_struct *tty,
 	usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
 			FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE,
 			FTDI_SIO_RESET_SIO,
-			priv->interface, buf, 0, WDR_TIMEOUT);
+			priv->interface, NULL, 0, WDR_TIMEOUT);
 
 	/* Termios defaults are set by usb_serial_init. We don't change
 	   port->tty->termios - this would lose speed settings, etc.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux