mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 17:12:06 +00:00
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: 1da81e5562
("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>
This commit is contained in:
parent
3dfac26e2e
commit
0f55f89d98
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user