Commit 5002921407ca0ae03d8066fa5b64b4dab868a361

Authored by Greg Kroah-Hartman

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>

Showing 2 changed files Side-by-side Diff

drivers/usb/serial/kobil_sct.c
... ... @@ -335,7 +335,8 @@
335 335 port->interrupt_out_urb->transfer_buffer_length = length;
336 336  
337 337 priv->cur_pos = priv->cur_pos + length;
338   - result = usb_submit_urb(port->interrupt_out_urb, GFP_NOIO);
  338 + result = usb_submit_urb(port->interrupt_out_urb,
  339 + GFP_ATOMIC);
339 340 dev_dbg(&port->dev, "%s - Send write URB returns: %i\n", __func__, result);
340 341 todo = priv->filled - priv->cur_pos;
341 342  
... ... @@ -350,7 +351,7 @@
350 351 if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
351 352 priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
352 353 result = usb_submit_urb(port->interrupt_in_urb,
353   - GFP_NOIO);
  354 + GFP_ATOMIC);
354 355 dev_dbg(&port->dev, "%s - Send read URB returns: %i\n", __func__, result);
355 356 }
356 357 }
drivers/usb/serial/opticon.c
... ... @@ -215,7 +215,7 @@
215 215  
216 216 /* The connected devices do not have a bulk write endpoint,
217 217 * to transmit data to de barcode device the control endpoint is used */
218   - dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_NOIO);
  218 + dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC);
219 219 if (!dr) {
220 220 count = -ENOMEM;
221 221 goto error_no_dr;