lkml.org 
[lkml]   [2019]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] tty: 8250: fix a missing check for pci_ioremap_bar
From
Date
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@umn.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

\
 
 \ /
  Last update: 2019-03-15 06:45    [W:0.025 / U:5.460 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site