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

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

             reply	other threads:[~2021-11-15  2:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15  2:18 Ilia Sergachev [this message]
2021-11-15  7:01 ` [PATCH] serial: liteuart: fix missing drvdata Greg Kroah-Hartman
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=20211115031808.7ab632ef@dtkw \
    --to=silia@ethz.ch \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=kgugala@antmicro.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=mholenko@antmicro.com \
    /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.