diff options
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 45975b4984ea..ff75a3589e7e 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/serial.h> | 35 | #include <linux/serial.h> |
36 | #include <linux/usb.h> | 36 | #include <linux/usb.h> |
37 | #include <linux/usb/serial.h> | 37 | #include <linux/usb/serial.h> |
38 | #include <linux/kfifo.h> | ||
38 | #include "pl2303.h" | 39 | #include "pl2303.h" |
39 | 40 | ||
40 | /* | 41 | /* |
@@ -625,6 +626,8 @@ static void port_release(struct device *dev) | |||
625 | usb_free_urb(port->write_urb); | 626 | usb_free_urb(port->write_urb); |
626 | usb_free_urb(port->interrupt_in_urb); | 627 | usb_free_urb(port->interrupt_in_urb); |
627 | usb_free_urb(port->interrupt_out_urb); | 628 | usb_free_urb(port->interrupt_out_urb); |
629 | if (!IS_ERR(port->write_fifo) && port->write_fifo) | ||
630 | kfifo_free(port->write_fifo); | ||
628 | kfree(port->bulk_in_buffer); | 631 | kfree(port->bulk_in_buffer); |
629 | kfree(port->bulk_out_buffer); | 632 | kfree(port->bulk_out_buffer); |
630 | kfree(port->interrupt_in_buffer); | 633 | kfree(port->interrupt_in_buffer); |
@@ -964,6 +967,10 @@ int usb_serial_probe(struct usb_interface *interface, | |||
964 | dev_err(&interface->dev, "No free urbs available\n"); | 967 | dev_err(&interface->dev, "No free urbs available\n"); |
965 | goto probe_error; | 968 | goto probe_error; |
966 | } | 969 | } |
970 | port->write_fifo = kfifo_alloc(PAGE_SIZE, GFP_KERNEL, | ||
971 | &port->lock); | ||
972 | if (IS_ERR(port->write_fifo)) | ||
973 | goto probe_error; | ||
967 | buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); | 974 | buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); |
968 | port->bulk_out_size = buffer_size; | 975 | port->bulk_out_size = buffer_size; |
969 | port->bulk_out_endpointAddress = endpoint->bEndpointAddress; | 976 | port->bulk_out_endpointAddress = endpoint->bEndpointAddress; |