[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <22a8194b-52d9-f954-ef80-8e56da859d8c@suse.cz>
Date: Fri, 15 Mar 2019 06:43:51 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: Kangjie Lu <kjlu@....edu>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, pakki001@....edu,
linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [PATCH] tty: 8250: fix a missing check for pci_ioremap_bar
On 15. 03. 19, 5:56, Kangjie Lu wrote:
> pci_ioremap_bar could fail. The fix captures the failure and
> pass an error code upstream. This can avoid potential NULL
> pointer dereferences in the future.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
> drivers/tty/serial/8250/8250_lpss.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
> index 98dbc796353f..e95332d8b35e 100644
> --- a/drivers/tty/serial/8250/8250_lpss.c
> +++ b/drivers/tty/serial/8250/8250_lpss.c
...
> @@ -203,7 +207,7 @@ static void qrk_serial_exit_dma(struct lpss8250 *lpss)
> dw_dma_remove(&lpss->dma_chip);
> }
> #else /* CONFIG_SERIAL_8250_DMA */
> -static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
> +static int qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
So you have to return something here now.
> static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
> #endif /* !CONFIG_SERIAL_8250_DMA */
>
regards,
--
js
suse labs
Powered by blists - more mailing lists