serial: liteuart: fix missing drvdata
Subsystems (2)
PATCH 1/1 serial: liteuart: fix missing drvdata
drvdata has to be set in _probe() - otherwise platform_get_drvdata() causes null pointer dereference BUG in _remove()
--- 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
Greg Kroah-Hartman
maintainerQuoted 23 lines · Ilia Sergachev
drvdata has to be set in
_probe()- otherwiseplatform_get_drvdata()causes null pointer dereference BUG in_remove()Signed-off-by Ilia Sergachev <[email protected]>--- 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
What commit does this fix?
thanks,
greg k-h
I'd say 1da81e5562fac8286567422cc56a7fbd0dc646d4 - where liteuart_probe() and liteuart_remove() were initially implemented.
Ilia
Quoted 5 lines · On Mon, 15 Nov 2021 08:01:55 +0100 Greg Kroah-Hartman…
What commit does this fix?
thanks,
greg k-h
Greg Kroah-Hartman
maintainerA: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
Quoted 2 lines · Ilia Sergachev
I'd say
1da81e5562fac8286567422cc56a7fbd0dc646d4- whereliteuart_probe()andliteuart_remove()were initially implemented.
Can you resend this with that information in the changelog as a "Fixes:" tag please?
thanks,
greg k-h
On Mon, Nov 15, 2021 at 4:34 AM Ilia Sergachev <[email protected]> wrote:
Besides what Greg asked for, can you rephrase Subject to something like "serial: liteuart: Fix NULL pointer dereference in ->remove()"
Quoted 2 lines
drvdata has to be set in
_probe()- otherwiseplatform_get_drvdata()causes null pointer dereference BUG in_remove()
Don't forget the grammatical period.
Code looks good to me, though.
Signature · 2 lines
With Best Regards, Andy Shevchenko