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,12 +557,11 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -557,12 +557,11 @@ 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) {
port->open_count = 0;
if (retval) { if (serial->type->owner)
port->open_count = 0; __MOD_DEC_USE_COUNT(serial->type->owner);
if (serial->type->owner) }
__MOD_DEC_USE_COUNT(serial->type->owner);
} }
up (&port->sem); up (&port->sem);
......
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