projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54b4cfe
)
serial: liteuart: Fix NULL pointer dereference in ->remove()
author
Ilia Sergachev
<silia@ethz.ch>
Mon, 15 Nov 2021 21:49:44 +0000
(22:49 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:57 +0000
(09:04 +0100)
commit
0f55f89d98c8b3e12b4f55f71c127a173e29557c
upstream.
drvdata has to be set in _probe() - otherwise platform_get_drvdata()
causes null pointer dereference BUG in _remove().
Fixes:
1da81e5562fa
("drivers/tty/serial: add LiteUART driver")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Ilia Sergachev <silia@ethz.ch>
Link:
https://lore.kernel.org/r/20211115224944.23f8c12b@dtkw
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/liteuart.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/tty/serial/liteuart.c
b/drivers/tty/serial/liteuart.c
index dbc0559a9157546c6377a433a7071d0b0dd74251..f075f4ff5fcfd7258078b8f41fa7c2ebc21a1860 100644
(file)
--- 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);
}