linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: 8250: dw: Fix NULL pointer dereference
@ 2022-05-02 11:56 Heikki Krogerus
  2022-05-02 12:12 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Heikki Krogerus @ 2022-05-02 11:56 UTC (permalink / raw)
  To: Andy Shevchenko, Greg Kroah-Hartman, Jiri Slaby
  Cc: Miquel Raynal, Emil Renner Berthing, Geert Uytterhoeven,
	linux-serial, linux-kernel

dw8250_platform_data is only used on DT platforms for now.

Fixes: 4a218b277fdb ("serial: 8250: dw: Create a generic platform data structure")
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
Hi,

I'm sorry, I have to resend this (to you guys).
I left out the mailing lists.

Br,
---
 drivers/tty/serial/8250/8250_dw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
index 0cf1a99dc1244..31422e44c64ff 100644
--- a/drivers/tty/serial/8250/8250_dw.c
+++ b/drivers/tty/serial/8250/8250_dw.c
@@ -433,9 +433,9 @@ static void dw8250_prepare_rx_dma(struct uart_8250_port *p)
 static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
 {
 	struct device_node *np = p->dev->of_node;
-	unsigned int quirks = data->pdata->quirks;
 
 	if (np) {
+		unsigned int quirks = data->pdata->quirks;
 		int id;
 
 		/* get index of serial line, if found in DT aliases */
-- 
2.35.1


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

* Re: [PATCH] serial: 8250: dw: Fix NULL pointer dereference
  2022-05-02 11:56 [PATCH] serial: 8250: dw: Fix NULL pointer dereference Heikki Krogerus
@ 2022-05-02 12:12 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2022-05-02 12:12 UTC (permalink / raw)
  To: Heikki Krogerus
  Cc: Greg Kroah-Hartman, Jiri Slaby, Miquel Raynal,
	Emil Renner Berthing, Geert Uytterhoeven, linux-serial,
	linux-kernel

On Mon, May 02, 2022 at 02:56:21PM +0300, Heikki Krogerus wrote:
> dw8250_platform_data is only used on DT platforms for now.

Ah, good catch, Heikki!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Thanks

> Fixes: 4a218b277fdb ("serial: 8250: dw: Create a generic platform data structure")
> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> Hi,
> 
> I'm sorry, I have to resend this (to you guys).
> I left out the mailing lists.
> 
> Br,
> ---
>  drivers/tty/serial/8250/8250_dw.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index 0cf1a99dc1244..31422e44c64ff 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -433,9 +433,9 @@ static void dw8250_prepare_rx_dma(struct uart_8250_port *p)
>  static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
>  {
>  	struct device_node *np = p->dev->of_node;
> -	unsigned int quirks = data->pdata->quirks;
>  
>  	if (np) {
> +		unsigned int quirks = data->pdata->quirks;
>  		int id;
>  
>  		/* get index of serial line, if found in DT aliases */
> -- 
> 2.35.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2022-05-02 12:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 11:56 [PATCH] serial: 8250: dw: Fix NULL pointer dereference Heikki Krogerus
2022-05-02 12:12 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).