diff options
author | Johan Hovold <johan@kernel.org> | 2014-10-29 04:07:30 -0400 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2014-11-03 03:07:28 -0500 |
commit | 191252837626fca0de694c18bb2aa64c118eda89 (patch) | |
tree | 37de857f1a7bb2685006bdc4730076b91beb6473 /drivers/usb | |
parent | 0df1f2487d2f0d04703f142813d53615d62a1da4 (diff) |
USB: kobil_sct: fix non-atomic allocation in write path
Write may be called from interrupt context so make sure to use
GFP_ATOMIC for all allocations in write.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 3d2bd65df0fc..02c420af251e 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -335,7 +335,8 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
335 | port->interrupt_out_urb->transfer_buffer_length = length; | 335 | port->interrupt_out_urb->transfer_buffer_length = length; |
336 | 336 | ||
337 | priv->cur_pos = priv->cur_pos + length; | 337 | priv->cur_pos = priv->cur_pos + length; |
338 | result = usb_submit_urb(port->interrupt_out_urb, GFP_NOIO); | 338 | result = usb_submit_urb(port->interrupt_out_urb, |
339 | GFP_ATOMIC); | ||
339 | dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result); | 340 | dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result); |
340 | todo = priv->filled - priv->cur_pos; | 341 | todo = priv->filled - priv->cur_pos; |
341 | 342 | ||
@@ -350,7 +351,7 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
350 | if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID || | 351 | if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID || |
351 | priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) { | 352 | priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) { |
352 | result = usb_submit_urb(port->interrupt_in_urb, | 353 | result = usb_submit_urb(port->interrupt_in_urb, |
353 | GFP_NOIO); | 354 | GFP_ATOMIC); |
354 | dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result); | 355 | dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result); |
355 | } | 356 | } |
356 | } | 357 | } |