mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
USB: opticon: fix non-atomic allocation in write path
commite681286de2upstream. Write may be called from interrupt context so make sure to use GFP_ATOMIC for all allocations in write. Fixes:0d930e51cf("USB: opticon: Add Opticon OPN2001 write support") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
b0476c8776
commit
547d682d56
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user