linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: linux-serial <linux-serial@vger.kernel.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	miquel.raynal@bootlin.com, phil.edworthy@renesas.com,
	kernel@esmil.dk, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] serial: 8250: dw: Fix NULL pointer dereference
Date: Wed, 29 Jun 2022 11:01:11 +0300 (EEST)	[thread overview]
Message-ID: <f70f0a6-1023-6833-fe6c-e82ca8e418d3@linux.intel.com> (raw)
In-Reply-To: <20220629000232.3440704-3-jeremy.linton@arm.com>

Hi,

Does cd16044d7c38 ("serial: 8250: dw: enable using pdata with ACPI") work 
for you? (Currently in tty-linus branch).

-- 
 i.


On Tue, 28 Jun 2022, Jeremy Linton wrote:

> Similarly to e6a08c6949cb, ACPI machines don't have
> a pdata setup, leading to a null pointer dereference
> when dw8250_handle_irq runs.
> 
> Fixes: aa63d786cea2 ("serial: 8250: dw: Add support for DMA flow controlling devices")
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> ---
>  drivers/tty/serial/8250/8250_dw.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c
> index 53e488beb8c2..06f80090cbb9 100644
> --- a/drivers/tty/serial/8250/8250_dw.c
> +++ b/drivers/tty/serial/8250/8250_dw.c
> @@ -237,10 +237,13 @@ static int dw8250_handle_irq(struct uart_port *p)
>  	struct dw8250_data *d = to_dw8250_data(p->private_data);
>  	unsigned int iir = p->serial_in(p, UART_IIR);
>  	bool rx_timeout = (iir & 0x3f) == UART_IIR_RX_TIMEOUT;
> -	unsigned int quirks = d->pdata->quirks;
> +	unsigned int quirks = 0;
>  	unsigned int status;
>  	unsigned long flags;
>  
> +	if (d->pdata)
> +		quirks = d->pdata->quirks;
> +
>  	/*
>  	 * There are ways to get Designware-based UARTs into a state where
>  	 * they are asserting UART_IIR_RX_TIMEOUT but there is no actual
> 


  reply	other threads:[~2022-06-29  8:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29  0:02 [PATCH 0/2] BUG, more dw8259 ACPI crashes Jeremy Linton
2022-06-29  0:02 ` [PATCH 1/2] Revert "serial: 8250: dw: Move the USR register to pdata" Jeremy Linton
2022-06-29  6:08   ` Greg KH
2022-06-29 14:38     ` Jeremy Linton
2022-06-29  0:02 ` [PATCH 2/2] serial: 8250: dw: Fix NULL pointer dereference Jeremy Linton
2022-06-29  8:01   ` Ilpo Järvinen [this message]
2022-06-29  7:43 ` [PATCH 0/2] BUG, more dw8259 ACPI crashes Miquel Raynal
2022-06-29 14:37 ` Jeremy Linton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f70f0a6-1023-6833-fe6c-e82ca8e418d3@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeremy.linton@arm.com \
    --cc=jirislaby@kernel.org \
    --cc=kernel@esmil.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=phil.edworthy@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).