aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-11 17:47:20 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-11 17:47:20 -0500
commitd7fc3ca1cd0ecce82263299c6b1631fc83b0ec79 (patch)
treea6471779a25cf2794542f9441213f5aa5f337f2f /drivers/usb/serial/usb-serial.c
parentfbfda6e71bbdd3b4d41a56c3f20f31762c455a5e (diff)
parented62178589929d248a0aaf4018ca3867e2f96d9d (diff)
Merge branch 'master'
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 4dd6865d32b..b5c96e74a90 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -242,8 +242,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
down(&port->sem);
- if (port->open_count == 0)
- goto out;
+ if (port->open_count == 0) {
+ up(&port->sem);
+ return;
+ }
--port->open_count;
if (port->open_count == 0) {
@@ -260,10 +262,8 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
module_put(port->serial->type->driver.owner);
}
- kref_put(&port->serial->kref, destroy_serial);
-
-out:
up(&port->sem);
+ kref_put(&port->serial->kref, destroy_serial);
}
static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count)