]> git.karo-electronics.de Git - linux-beck.git/commitdiff
serial: core: Cleanup uart_open() exit
authorPeter Hurley <peter@hurleysoftware.com>
Mon, 11 Jan 2016 04:23:59 +0000 (20:23 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Jan 2016 22:17:42 +0000 (14:17 -0800)
If aborting uart_open() unsuccessfully, retval is non-zero, so the
existing fall-through exit is equivalent.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index 1e7430c60ee6497a5a8dcd24fb102098fdc143bb..5cf0697564972883beae329f43ab6d59b8035947 100644 (file)
@@ -1622,15 +1622,12 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
        /*
         * If we succeeded, wait until the port is ready.
         */
+err_unlock:
        mutex_unlock(&port->mutex);
        if (retval == 0)
                retval = tty_port_block_til_ready(port, tty, filp);
-
 end:
        return retval;
-err_unlock:
-       mutex_unlock(&port->mutex);
-       goto end;
 }
 
 static const char *uart_type(struct uart_port *port)