All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ilia Sergachev <silia@ethz.ch>
Cc: linux-serial@vger.kernel.org, Karol Gugala <kgugala@antmicro.com>,
	Mateusz Holenko <mholenko@antmicro.com>,
	Jiri Slaby <jirislaby@kernel.org>
Subject: Re: [PATCH] serial: liteuart: fix missing drvdata
Date: Mon, 15 Nov 2021 08:01:55 +0100	[thread overview]
Message-ID: <YZIF48DPkfgBf5H9@kroah.com> (raw)
In-Reply-To: <20211115031808.7ab632ef@dtkw>

On Mon, Nov 15, 2021 at 03:18:08AM +0100, Ilia Sergachev wrote:
> drvdata has to be set in _probe() - otherwise platform_get_drvdata()
> causes null pointer dereference BUG in _remove()
> 
> Signed-off-by: Ilia Sergachev <silia@ethz.ch>
> ---
>  drivers/tty/serial/liteuart.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c
> index dbc0559a9157..f075f4ff5fcf 100644
> --- a/drivers/tty/serial/liteuart.c
> +++ b/drivers/tty/serial/liteuart.c
> @@ -285,6 +285,8 @@ static int liteuart_probe(struct platform_device *pdev)
>  	port->line = dev_id;
>  	spin_lock_init(&port->lock);
>  
> +	platform_set_drvdata(pdev, port);
> +
>  	return uart_add_one_port(&liteuart_driver, &uart->port);
>  }
>  
> -- 
> 2.25.1

What commit does this fix?

thanks,

greg k-h

  reply	other threads:[~2021-11-15  7:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  2:18 [PATCH] serial: liteuart: fix missing drvdata Ilia Sergachev
2021-11-15  7:01 ` Greg Kroah-Hartman [this message]
2021-11-15  9:21   ` Ilia Sergachev
2021-11-15  9:34     ` Greg Kroah-Hartman
2021-11-15 10:47 ` Andy Shevchenko

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=YZIF48DPkfgBf5H9@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kgugala@antmicro.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=mholenko@antmicro.com \
    --cc=silia@ethz.ch \
    /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.