diff options
author | Johan Hovold <jhovold@gmail.com> | 2009-12-29 01:01:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-03 01:53:56 +0300 |
commit | d2126326bd71b56fcaa5e86474433d11e253f84d (patch) | |
tree | 67fb9604d46b721c94e6246d55c0bfd3c6101e60 /drivers | |
parent | 9e221a35f82cbef0397d81fed588bafba95b550c (diff) | |
download | linux-d2126326bd71b56fcaa5e86474433d11e253f84d.tar.xz |
USB: oti6858: fix DMA buffer on stack
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/oti6858.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index c644e26394b4..2ae97e7195c6 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c @@ -302,7 +302,7 @@ void send_data(struct work_struct *work) struct usb_serial_port *port = priv->port; int count = 0, result; unsigned long flags; - unsigned char allow; + u8 *allow; dbg("%s(port = %d)", __func__, port->number); @@ -321,13 +321,20 @@ void send_data(struct work_struct *work) count = port->bulk_out_size; if (count != 0) { + allow = kmalloc(1, GFP_KERNEL); + if (!allow) { + dev_err(&port->dev, "%s(): kmalloc failed\n", + __func__); + return; + } result = usb_control_msg(port->serial->dev, usb_rcvctrlpipe(port->serial->dev, 0), OTI6858_REQ_T_CHECK_TXBUFF, OTI6858_REQ_CHECK_TXBUFF, - count, 0, &allow, 1, 100); - if (result != 1 || allow != 0) + count, 0, allow, 1, 100); + if (result != 1 || *allow != 0) count = 0; + kfree(allow); } if (count == 0) { |