Commit 9a50ad7f authored by Stuart MacDonald's avatar Stuart MacDonald Committed by Greg Kroah-Hartman

[PATCH] USB: clean up the error logic for open() in the usb-serial driver

This cleans up the error path in the open() call to make a bit more
sense.
parent 20e3be5f
...@@ -557,13 +557,12 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -557,13 +557,12 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
retval = serial->type->open(port, filp); retval = serial->type->open(port, filp);
else else
retval = generic_open(port, filp); retval = generic_open(port, filp);
}
if (retval) { if (retval) {
port->open_count = 0; port->open_count = 0;
if (serial->type->owner) if (serial->type->owner)
__MOD_DEC_USE_COUNT(serial->type->owner); __MOD_DEC_USE_COUNT(serial->type->owner);
} }
}
up (&port->sem); up (&port->sem);
return retval; return retval;
......
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