USB-serial fixes for v3.18-rc4

Two fixes of non-atomic allocations in write paths.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUW65SAAoJEEEN5E/e4bSVgf4QAK3o9qhiLD01fK8kIpRbh8jB
 joRKQRY6X+cOp6twlZrZChtqCkbMHtoZHvmhxRhkD8oj/qE1AeYhdUyq71aVm64R
 GMJDmFawEkPHuvIZ/dlzzuhrbugZf6TBtjFBfVzHtpyMm0wJu8ogtml3R5MgDhut
 WWWdKUq0D1yi9otDAaFCEkca3P5z+qeDpkLzETmwMIqzheGp1gbCpWXFTM51KUS8
 KP4t1HliVGXapBtF+vuvc2jmjqxm+Yfeyp43iR8yMiUShpXUgOw9/D1qSdZK2PPj
 JJTeUyAso0sZnWDB62TSe54stm7Bacfg802/GHMPdkprYINzNKWpRw3mKrvOI5HZ
 sDBbpz6SxTdHtzIQw/IHvhZLk1F2sb0Fk/PmN7r5yNRvSB6zebAVGLWl70RT3d82
 aawvzuMoKp54/YNGCByvqKvrFXl61PRRwVYyoKVRiTxT8vlSdlxReAwVDCWcukqI
 1IshcUN6oLZmQ/tgQYlaA6f6wtBCCz73ZPxm2cYvJiBisCYGN0Y5CBL7faB/ocW8
 +2kv5/rKyQD9bzTJTB9F0FdSqiM0hd9W7DVuuNFS8Nhp4KTP6ez6pASic0us8vkE
 bbF2kOdepu46/dDKyX7HchIy0Ek/tL2f3qWSJ/AHiSRXPjwOJ9t9sjSpLWDuCya1
 w5nEVbGmlq/arjbQ5emg
 =QlS+
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-3.18-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v3.18-rc4

Two fixes of non-atomic allocations in write paths.

Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
Greg Kroah-Hartman 2014-11-06 12:22:36 -08:00
commit 5002921407
2 changed files with 4 additions and 3 deletions

View file

@ -335,7 +335,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;
@ -350,7 +351,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);
}
}

View file

@ -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;