-
Al Borchers authored
Here is a new version of the patch to usb-serial.c to fix the unbalanced kref and module get/put in serial_open and serial_close when there are errors. This version works correctly when try_module_get fails and now "rmmod --wait" works correctly. * If the low level usb serial open fails, the kref and module use counts are decremented once in open. Before, they were mistakenly decremented again in close. * If try_module_get fails, the module use count is not changed. Before, the module use count was mistakenly decremented. Now "rmmod --wait" works correctly. * The tty->driver_data pointer is never set to NULL once the port is open. Before there was a small window when it was mistakenly set to NULL for an already open port. Signed-off-by: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
adddb9fd