diff options
author | Frank Gevaerts <frank.gevaerts@fks.be> | 2006-06-14 09:52:05 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 18:04:17 -0400 |
commit | b059c81af7a1759a911cfc20ce8a4bf47c435830 (patch) | |
tree | 397568ad8fe0ebfd2ee504919f7ae8f12657703f /drivers/usb/serial | |
parent | 4186c29ca199063facdda49851b4c863699687b1 (diff) |
[PATCH] USB Serial: clean tty fields on failed device open
If either the driver's open() method or try_module_get() fails, we need to
set 'tty->driver_data' and 'port->tty' to NULL in serial_open(), otherwise
we'll get an OOPS in usb_device_disconnect() when the device is disconnected.
Signed-off-by: Frank Gevaerts <frank.gevaerts@fks.be>
Acked-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index cbca3402d6cd..92c213fa9317 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -237,6 +237,8 @@ bailout_module_put: | |||
237 | module_put(serial->type->driver.owner); | 237 | module_put(serial->type->driver.owner); |
238 | bailout_mutex_unlock: | 238 | bailout_mutex_unlock: |
239 | port->open_count = 0; | 239 | port->open_count = 0; |
240 | tty->driver_data = NULL; | ||
241 | port->tty = NULL; | ||
240 | mutex_unlock(&port->mutex); | 242 | mutex_unlock(&port->mutex); |
241 | bailout_kref_put: | 243 | bailout_kref_put: |
242 | usb_serial_put(serial); | 244 | usb_serial_put(serial); |