From 69e0e28fd335f1aade85e91ad5913339a444940a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 25 Nov 2008 03:53:09 -0800 Subject: [PATCH] --- yaml --- r: 122148 b: refs/heads/master c: 2f9889a20cd2854bc6305198255c617b0b4eb719 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/net/usb/hso.c | 11 ++--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 9903c3531f9c..e140a0aa241a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ab153d84d9609b4e6f53632a6f14b882e866cb47 +refs/heads/master: 2f9889a20cd2854bc6305198255c617b0b4eb719 diff --git a/trunk/drivers/net/usb/hso.c b/trunk/drivers/net/usb/hso.c index 39df44f99d65..c5c1aeae94fe 100644 --- a/trunk/drivers/net/usb/hso.c +++ b/trunk/drivers/net/usb/hso.c @@ -1235,11 +1235,6 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) } mutex_lock(&serial->parent->mutex); - /* check for port already opened, if not set the termios */ - /* The serial->open count needs to be here as hso_serial_close - * will be called even if hso_serial_open returns -ENODEV. - */ - serial->open_count++; result = usb_autopm_get_interface(serial->parent->interface); if (result < 0) goto err_out; @@ -1251,6 +1246,8 @@ static int hso_serial_open(struct tty_struct *tty, struct file *filp) tty->driver_data = serial; serial->tty = tty; + /* check for port already opened, if not set the termios */ + serial->open_count++; if (serial->open_count == 1) { tty->low_latency = 1; serial->rx_state = RX_IDLE; @@ -1288,10 +1285,6 @@ static void hso_serial_close(struct tty_struct *tty, struct file *filp) u8 usb_gone; D1("Closing serial port"); - if (serial == NULL || serial->magic != HSO_SERIAL_MAGIC) { - D1("invalid serial structure bailing out.\n"); - return; - } mutex_lock(&serial->parent->mutex); usb_gone = serial->parent->usb_gone;