From dfeb8be48423f505b953126be921a395bd0c9bb2 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Wed, 23 Feb 2011 15:28:18 -0500 Subject: [PATCH] --- yaml --- r: 235353 b: refs/heads/master c: 969e3033ae7733a0af8f7742ca74cd16c0857e71 h: refs/heads/master i: 235351: f2f74aa43b31900e6d8f386394f6f795d2bf5a22 v: v3 --- [refs] | 2 +- trunk/drivers/usb/serial/usb-serial.c | 5 ++--- trunk/include/linux/usb/serial.h | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index cf41cdc66e36..711aec09ee4d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 22ced6874fc47bb051e7460443e454ca8efc457e +refs/heads/master: 969e3033ae7733a0af8f7742ca74cd16c0857e71 diff --git a/trunk/drivers/usb/serial/usb-serial.c b/trunk/drivers/usb/serial/usb-serial.c index 546a52179bec..2ff90a9c8f47 100644 --- a/trunk/drivers/usb/serial/usb-serial.c +++ b/trunk/drivers/usb/serial/usb-serial.c @@ -911,9 +911,8 @@ int usb_serial_probe(struct usb_interface *interface, dev_err(&interface->dev, "No free urbs available\n"); goto probe_error; } - buffer_size = serial->type->bulk_in_size; - if (!buffer_size) - buffer_size = le16_to_cpu(endpoint->wMaxPacketSize); + buffer_size = max_t(int, serial->type->bulk_in_size, + le16_to_cpu(endpoint->wMaxPacketSize)); port->bulk_in_size = buffer_size; port->bulk_in_endpointAddress = endpoint->bEndpointAddress; port->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); diff --git a/trunk/include/linux/usb/serial.h b/trunk/include/linux/usb/serial.h index c9049139a7a5..45f3b9db4258 100644 --- a/trunk/include/linux/usb/serial.h +++ b/trunk/include/linux/usb/serial.h @@ -191,7 +191,8 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) * @id_table: pointer to a list of usb_device_id structures that define all * of the devices this structure can support. * @num_ports: the number of different ports this device will have. - * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size) + * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer + * (0 = end-point size) * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) * @calc_num_ports: pointer to a function to determine how many ports this * device has dynamically. It will be called after the probe()