diff options
author | Johan Hovold <johan@kernel.org> | 2014-10-29 09:07:31 +0100 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-11-13 19:02:54 +0100 |
commit | b7b72e586240ab69fc5bc30c65005bebae0f8793 (patch) | |
tree | ec787a4e5958ac5f7b2a8752280c489b71684507 | |
parent | 2aa227341252dc88670a9814793975f1e685e74c (diff) |
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: Jiri Slaby <jslaby@suse.cz>
-rw-r--r-- | drivers/usb/serial/opticon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index cbe779f578f9..df495ea0d977 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -219,7 +219,7 @@ static int opticon_write(struct tty_struct *tty, struct usb_serial_port *port, /* The conncected 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) { dev_err(&port->dev, "out of memory\n"); count = -ENOMEM; |