All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_p
Date: Wed, 03 Jul 2019 07:47:49 +0000	[thread overview]
Message-ID: <5D1C5DA5.9030907@bfs.de> (raw)
In-Reply-To: <20190703055908.141294-1-weiyongjun1@huawei.com>



Am 03.07.2019 07:59, schrieb Wei Yongjun:
> Add the missing unlock before return from function serial8250_register_8250_port()
> in the error handling case.
> 
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/tty/serial/8250/8250_core.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index a4470771005f..df3bcc0b2d74 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -1026,8 +1026,10 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
>  		if (!has_acpi_companion(uart->port.dev)) {
>  			gpios = mctrl_gpio_init(&uart->port, 0);
>  			if (IS_ERR(gpios)) {
> -				if (PTR_ERR(gpios) != -ENOSYS)
> -					return PTR_ERR(gpios);
> +				if (PTR_ERR(gpios) != -ENOSYS) {
> +					ret = PTR_ERR(gpios);
> +					goto out_unlock;
> +				}
>  			} else {
>  				uart->gpios = gpios;
>  			}
> @@ -1099,6 +1101,7 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
>  		}
>  	}
>  
> +out_unlock:
>  	mutex_unlock(&serial_mutex);
>  
>  	return ret;
> 


i am sorry but i do not understand these ENOSYS path.
So far i can see uart->gpios will be uninitialized, is that really intended ?

re,
 wh

      reply	other threads:[~2019-07-03  7:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03  5:59 [PATCH -next] serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_port( Wei Yongjun
2019-07-03  7:47 ` walter harms [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D1C5DA5.9030907@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.