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

* Re: [PATCH] serial: liteuart: fix missing drvdata
  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 10:47 ` Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-11-15  7:01 UTC (permalink / raw)
  To: Ilia Sergachev; +Cc: linux-serial, Karol Gugala, Mateusz Holenko, Jiri Slaby

On Mon, Nov 15, 2021 at 03:18:08AM +0100, Ilia Sergachev wrote:
> 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

What commit does this fix?

thanks,

greg k-h

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

* Re: [PATCH] serial: liteuart: fix missing drvdata
  2021-11-15  7:01 ` Greg Kroah-Hartman
@ 2021-11-15  9:21   ` Ilia Sergachev
  2021-11-15  9:34     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Ilia Sergachev @ 2021-11-15  9:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-serial, Karol Gugala, Mateusz Holenko, Jiri Slaby

I'd say 1da81e5562fac8286567422cc56a7fbd0dc646d4 - where 
liteuart_probe() and liteuart_remove() were initially implemented.

Ilia

On Mon, 15 Nov 2021 08:01:55 +0100
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:

> What commit does this fix?
> 
> thanks,
> 
> greg k-h

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

* Re: [PATCH] serial: liteuart: fix missing drvdata
  2021-11-15  9:21   ` Ilia Sergachev
@ 2021-11-15  9:34     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-11-15  9:34 UTC (permalink / raw)
  To: Ilia Sergachev; +Cc: linux-serial, Karol Gugala, Mateusz Holenko, Jiri Slaby

A: 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

On Mon, Nov 15, 2021 at 10:21:48AM +0100, Ilia Sergachev wrote:
> I'd say 1da81e5562fac8286567422cc56a7fbd0dc646d4 - where 
> liteuart_probe() and liteuart_remove() were initially implemented.

Can you resend this with that information in the changelog as a "Fixes:"
tag please?

thanks,

greg k-h

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

* Re: [PATCH] serial: liteuart: fix missing drvdata
  2021-11-15  2:18 [PATCH] serial: liteuart: fix missing drvdata Ilia Sergachev
  2021-11-15  7:01 ` Greg Kroah-Hartman
@ 2021-11-15 10:47 ` Andy Shevchenko
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2021-11-15 10:47 UTC (permalink / raw)
  To: Ilia Sergachev
  Cc: open list:SERIAL DRIVERS, Karol Gugala, Mateusz Holenko,
	Jiri Slaby, Greg Kroah-Hartman

On Mon, Nov 15, 2021 at 4:34 AM Ilia Sergachev <silia@ethz.ch> wrote:

Besides what Greg asked for, can you rephrase Subject to something like
"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()

Don't forget the grammatical period.

Code looks good to me, though.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[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.