Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26672
b: refs/heads/master
c: 71a8416
h: refs/heads/master
v: v3
  • Loading branch information
Luiz Fernando Capitulino authored and Greg Kroah-Hartman committed May 12, 2006
1 parent 8bba981 commit b601ef9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 704936a25bda9bb12e35bb222d5e3f26186dc279
refs/heads/master: 71a84163ca6b4e36744978385e94150af32f9d75
17 changes: 11 additions & 6 deletions trunk/drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@ static int serial_open (struct tty_struct *tty, struct file * filp)

portNumber = tty->index - serial->minor;
port = serial->port[portNumber];
if (!port)
return -ENODEV;
if (!port) {
retval = -ENODEV;
goto bailout_kref_put;
}

if (mutex_lock_interruptible(&port->mutex))
return -ERESTARTSYS;
if (mutex_lock_interruptible(&port->mutex)) {
retval = -ERESTARTSYS;
goto bailout_kref_put;
}

++port->open_count;

Expand All @@ -209,7 +213,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
* safe because we are called with BKL held */
if (!try_module_get(serial->type->driver.owner)) {
retval = -ENODEV;
goto bailout_kref_put;
goto bailout_mutex_unlock;
}

/* only call the device specific open if this
Expand All @@ -224,9 +228,10 @@ static int serial_open (struct tty_struct *tty, struct file * filp)

bailout_module_put:
module_put(serial->type->driver.owner);
bailout_kref_put:
bailout_mutex_unlock:
port->open_count = 0;
mutex_unlock(&port->mutex);
bailout_kref_put:
kref_put(&serial->kref, destroy_serial);
return retval;
}
Expand Down

0 comments on commit b601ef9

Please sign in to comment.