Commit a1f721c8 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

USB: further fix for usb-serial

this is a fix for the outstanding usb-serial issues.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c744f99e
...@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po ...@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po
continue; continue;
*minor = i; *minor = i;
j = 0;
dbg("%s - minor base = %d", __FUNCTION__, *minor); dbg("%s - minor base = %d", __FUNCTION__, *minor);
for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) {
serial_table[i] = serial; serial_table[i] = serial;
serial->port[j++]->number = i;
}
spin_unlock(&table_lock); spin_unlock(&table_lock);
return serial; return serial;
} }
...@@ -847,7 +850,6 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -847,7 +850,6 @@ int usb_serial_probe(struct usb_interface *interface,
port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL);
if (!port) if (!port)
goto probe_error; goto probe_error;
port->number = i + serial->minor;
port->serial = serial; port->serial = serial;
spin_lock_init(&port->lock); spin_lock_init(&port->lock);
mutex_init(&port->mutex); mutex_init(&port->mutex);
...@@ -1035,9 +1037,6 @@ probe_error: ...@@ -1035,9 +1037,6 @@ probe_error:
kfree(port->interrupt_out_buffer); kfree(port->interrupt_out_buffer);
} }
/* return the minor range that this device had */
return_serial (serial);
/* free up any memory that we allocated */ /* free up any memory that we allocated */
for (i = 0; i < serial->num_port_pointers; ++i) for (i = 0; i < serial->num_port_pointers; ++i)
kfree(serial->port[i]); kfree(serial->port[i]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment