serial: liteuart: Fix NULL pointer dereference in ->remove()
Subsystems (2)
PATCH v3 1/1 serial: liteuart: Fix NULL pointer dereference in ->remove()
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")
Reviewed-by Johan Hovold <[email protected]>
Signed-off-by Ilia Sergachev <[email protected]>
---
v2 -> v3: update subject and description
v1 -> v2: add Fixes:
drivers/tty/serial/liteuart.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/tty/serial/liteuart.c +2 -0
@@ -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); }
Signature · 1 line
2.25.1