Commit 9b3087e9 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge gregkh@kernel.bkbits.net:linux/usb-2.6

into kroah.com:/home/greg/linux/BK/usb-2.6
parents f61aa42b 9502357c
...@@ -478,7 +478,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -478,7 +478,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
struct usb_serial *serial; struct usb_serial *serial;
struct usb_serial_port *port; struct usb_serial_port *port;
unsigned int portNumber; unsigned int portNumber;
int retval = 0; int retval = -ENODEV;
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
...@@ -487,10 +487,8 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -487,10 +487,8 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
/* get the serial object associated with this tty pointer */ /* get the serial object associated with this tty pointer */
serial = usb_serial_get_by_index(tty->index); serial = usb_serial_get_by_index(tty->index);
if (!serial) { if (!serial)
retval = -ENODEV;
goto bailout; goto bailout;
}
/* set up our port structure making the tty driver remember our port object, and us it */ /* set up our port structure making the tty driver remember our port object, and us it */
portNumber = tty->index - serial->minor; portNumber = tty->index - serial->minor;
...@@ -502,10 +500,11 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -502,10 +500,11 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
/* lock this module before we call it, /* lock this module before we call it,
this may, which means we must bail out, safe because we are called with BKL held */ this may, which means we must bail out, safe because we are called with BKL held */
if (!try_module_get(serial->type->owner)) { if (!try_module_get(serial->type->owner)) {
retval = -ENODEV; kref_put(&serial->kref, destroy_serial);
goto bailout; goto bailout;
} }
retval = 0;
++port->open_count; ++port->open_count;
if (port->open_count == 1) { if (port->open_count == 1) {
/* only call the device specific open if this /* only call the device specific open if this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment