summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2014-10-29 09:07:31 +0100
committerJohan Hovold <johan@kernel.org>2014-11-03 09:07:30 +0100
commite681286de221af78fc85db9222b6a203148c005a (patch)
tree10200bb2cafde8e2097b2ad139eb66042c1dda63 /drivers/usb
parentUSB: kobil_sct: fix non-atomic allocation in write path (diff)
downloadlinux-e681286de221af78fc85db9222b6a203148c005a.tar.xz
linux-e681286de221af78fc85db9222b6a203148c005a.zip
USB: opticon: 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: 0d930e51cfe6 ("USB: opticon: Add Opticon OPN2001 write support") 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/opticon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index 4856fb7e637e..4b7bfb394a32 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -215,7 +215,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port,
/* The connected devices do not have a bulk write endpoint,
* to transmit data to de barcode device the control endpoint is used */
- dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
+ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
if (!dr) {
count = -ENOMEM;
goto error_no_dr;