From: Heikki Krogerus Date: Mon, 2 May 2022 11:56:21 +0000 (+0300) Subject: serial: 8250: dw: Fix NULL pointer dereference X-Git-Tag: baikal/mips/sdk6.1~5586^2~70 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=84ffa01e2a24c70c40d33be817d91fe3d3f3555e;p=kernel.git serial: 8250: dw: Fix NULL pointer dereference dw8250_platform_data is only used on DT platforms for now. Fixes: 99cdec19d3a7 ("serial: 8250: dw: Create a generic platform data structure") Signed-off-by: Heikki Krogerus Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220502115621.77985-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- 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 */