diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-25 06:53:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-25 06:53:09 -0500 |
commit | 2f9889a20cd2854bc6305198255c617b0b4eb719 (patch) | |
tree | 1b577cd6c8fe1b2233e63ad1c8ed999615315d3c /drivers/net/usb | |
parent | ab153d84d9609b4e6f53632a6f14b882e866cb47 (diff) |
Revert "hso: Fix crashes on close."
This reverts commit 4a3e818181e1baf970e9232ca8b747e233176b87.
On request from Alan Cox.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r-- | drivers/net/usb/hso.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 39df44f99d65..c5c1aeae94fe 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -1235,11 +1235,6 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) | |||
1235 | } | 1235 | } |
1236 | 1236 | ||
1237 | mutex_lock(&serial->parent->mutex); | 1237 | mutex_lock(&serial->parent->mutex); |
1238 | /* check for port already opened, if not set the termios */ | ||
1239 | /* The serial->open count needs to be here as hso_serial_close | ||
1240 | * will be called even if hso_serial_open returns -ENODEV. | ||
1241 | */ | ||
1242 | serial->open_count++; | ||
1243 | result = usb_autopm_get_interface(serial->parent->interface); | 1238 | result = usb_autopm_get_interface(serial->parent->interface); |
1244 | if (result < 0) | 1239 | if (result < 0) |
1245 | goto err_out; | 1240 | goto err_out; |
@@ -1251,6 +1246,8 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) | |||
1251 | tty->driver_data = serial; | 1246 | tty->driver_data = serial; |
1252 | serial->tty = tty; | 1247 | serial->tty = tty; |
1253 | 1248 | ||
1249 | /* check for port already opened, if not set the termios */ | ||
1250 | serial->open_count++; | ||
1254 | if (serial->open_count == 1) { | 1251 | if (serial->open_count == 1) { |
1255 | tty->low_latency = 1; | 1252 | tty->low_latency = 1; |
1256 | serial->rx_state = RX_IDLE; | 1253 | serial->rx_state = RX_IDLE; |
@@ -1288,10 +1285,6 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) | |||
1288 | u8 usb_gone; | 1285 | u8 usb_gone; |
1289 | 1286 | ||
1290 | D1("Closing serial port"); | 1287 | D1("Closing serial port"); |
1291 | if (serial == NULL || serial->magic != HSO_SERIAL_MAGIC) { | ||
1292 | D1("invalid serial structure bailing out.\n"); | ||
1293 | return; | ||
1294 | } | ||
1295 | 1288 | ||
1296 | mutex_lock(&serial->parent->mutex); | 1289 | mutex_lock(&serial->parent->mutex); |
1297 | usb_gone = serial->parent->usb_gone; | 1290 | usb_gone = serial->parent->usb_gone; |