diff options
author | Johan Hovold <johan@kernel.org> | 2014-10-29 09:07:30 +0100 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-11-13 19:02:55 +0100 |
commit | b67eae0838424db8b4bb2f49024922df6792d0bb (patch) | |
tree | 776cba0e8b225bcba997fa8e91d2148f6ba9501d /drivers | |
parent | bfdb4179ec3f9339062196ce922431ff27a2d99d (diff) | |
download | lwn-b67eae0838424db8b4bb2f49024922df6792d0bb.tar.gz lwn-b67eae0838424db8b4bb2f49024922df6792d0bb.zip |
USB: kobil_sct: fix non-atomic allocation in write path
commit 191252837626fca0de694c18bb2aa64c118eda89 upstream.
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")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers')
-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 78b48c31abf5..efa75b4e51f2 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c @@ -336,7 +336,8 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, port->interrupt_out_urb->transfer_buffer_length = length; priv->cur_pos = priv->cur_pos + length; - result = usb_submit_urb(port->interrupt_out_urb, GFP_NOIO); + result = usb_submit_urb(port->interrupt_out_urb, + GFP_ATOMIC); dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result); todo = priv->filled - priv->cur_pos; @@ -351,7 +352,7 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID || priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) { result = usb_submit_urb(port->interrupt_in_urb, - GFP_NOIO); + GFP_ATOMIC); dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result); } } |