All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] serial: liteuart: fix missing drvdata
@ 2021-11-15  2:18 Ilia Sergachev
  2021-11-15  7:01 ` Greg Kroah-Hartman
  2021-11-15 10:47 ` Andy Shevchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Ilia Sergachev @ 2021-11-15  2:18 UTC (permalink / raw)
  To: linux-serial
  Cc: Karol Gugala, Mateusz Holenko, Jiri Slaby, Greg Kroah-Hartman,
	Ilia Sergachev

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-15 10:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15  2:18 [PATCH] serial: liteuart: fix missing drvdata Ilia Sergachev
2021-11-15  7:01 ` 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

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.