diff options
author | Stefani Seibold <stefani@seibold.net> | 2009-12-23 03:10:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-23 11:53:31 -0500 |
commit | 119eecc831a42bd090543568932e440c6831f1bb (patch) | |
tree | fc57e3afc6e419522c1294787b03e3798f69ea43 /drivers/usb/serial/usb-serial.c | |
parent | c9f937e4a3f4ebf9924ec21d80632e5eb61d949c (diff) |
Fix usb_serial_probe() problem introduced by the recent kfifo changes
The USB serial code was a new user of the kfifo API, and it was missed
when porting things to the new kfifo API.
Please make the write_fifo in place. Here is my patch to fix the
regression and full ported version.
Signed-off-by: Stefani Seibold <stefani@seibold.net>
Reported-and-tested-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 636a4f23445e..33c85f7084f8 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -595,8 +595,7 @@ static void port_release(struct device *dev) | |||
595 | usb_free_urb(port->write_urb); | 595 | usb_free_urb(port->write_urb); |
596 | usb_free_urb(port->interrupt_in_urb); | 596 | usb_free_urb(port->interrupt_in_urb); |
597 | usb_free_urb(port->interrupt_out_urb); | 597 | usb_free_urb(port->interrupt_out_urb); |
598 | if (!IS_ERR(port->write_fifo) && port->write_fifo) | 598 | kfifo_free(&port->write_fifo); |
599 | kfifo_free(port->write_fifo); | ||
600 | kfree(port->bulk_in_buffer); | 599 | kfree(port->bulk_in_buffer); |
601 | kfree(port->bulk_out_buffer); | 600 | kfree(port->bulk_out_buffer); |
602 | kfree(port->interrupt_in_buffer); | 601 | kfree(port->interrupt_in_buffer); |
@@ -939,7 +938,7 @@ int usb_serial_probe(struct usb_interface *interface, | |||
939 | dev_err(&interface->dev, "No free urbs available\n"); | 938 | dev_err(&interface->dev, "No free urbs available\n"); |
940 | goto probe_error; | 939 | goto probe_error; |
941 | } | 940 | } |
942 | if (kfifo_alloc(port->write_fifo, PAGE_SIZE, GFP_KERNEL)) | 941 | if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL)) |
943 | goto probe_error; | 942 | goto probe_error; |
944 | buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); | 943 | buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); |
945 | port->bulk_out_size = buffer_size; | 944 | port->bulk_out_size = buffer_size; |