aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2014-10-29 09:07:31 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-14 09:00:07 -0800
commitf139c208ab95e8c96d19e360f64c549d9f74dc34 (patch)
tree5fb95d2ff296c1ed4410ad869fe74d8a6d133797
parent2db5726475502275f52098111ea0eff0700df07c (diff)
downloadlinux-yocto-f139c208ab95e8c96d19e360f64c549d9f74dc34.tar.gz
linux-yocto-f139c208ab95e8c96d19e360f64c549d9f74dc34.tar.bz2
linux-yocto-f139c208ab95e8c96d19e360f64c549d9f74dc34.zip
USB: opticon: fix non-atomic allocation in write path
commit e681286de221af78fc85db9222b6a203148c005a upstream. 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") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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;