aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/usb-serial.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 9dbd1fa84e88..8511352251f3 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po
99 continue; 99 continue;
100 100
101 *minor = i; 101 *minor = i;
102 j = 0;
102 dbg("%s - minor base = %d", __FUNCTION__, *minor); 103 dbg("%s - minor base = %d", __FUNCTION__, *minor);
103 for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) 104 for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) {
104 serial_table[i] = serial; 105 serial_table[i] = serial;
106 serial->port[j++]->number = i;
107 }
105 spin_unlock(&table_lock); 108 spin_unlock(&table_lock);
106 return serial; 109 return serial;
107 } 110 }
@@ -847,7 +850,6 @@ int usb_serial_probe(struct usb_interface *interface,
847 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); 850 port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL);
848 if (!port) 851 if (!port)
849 goto probe_error; 852 goto probe_error;
850 port->number = i + serial->minor;
851 port->serial = serial; 853 port->serial = serial;
852 spin_lock_init(&port->lock); 854 spin_lock_init(&port->lock);
853 mutex_init(&port->mutex); 855 mutex_init(&port->mutex);
@@ -1035,9 +1037,6 @@ probe_error:
1035 kfree(port->interrupt_out_buffer); 1037 kfree(port->interrupt_out_buffer);
1036 } 1038 }
1037 1039
1038 /* return the minor range that this device had */
1039 return_serial (serial);
1040
1041 /* free up any memory that we allocated */ 1040 /* free up any memory that we allocated */
1042 for (i = 0; i < serial->num_port_pointers; ++i) 1041 for (i = 0; i < serial->num_port_pointers; ++i)
1043 kfree(serial->port[i]); 1042 kfree(serial->port[i]);