Commit fb139dfe authored by Alexander Stein's avatar Alexander Stein Committed by Linus Torvalds

drivers/tty/serial/pch_uart.c: don't oops if dmi_get_system_info returns NULL

If dmi_get_system_info() returns NULL, pch_uart_init_port() will
dereferencea a zero pointer.

This oops was observed on an Atom based board which has no BIOS, but
a bootloder which doesn't provide DMI data.
Signed-off-by: default avatarAlexander Stein <alexander.stein@systec-electronic.com>
Cc: Greg KH <gregkh@suse.de>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 273ef950
...@@ -1397,6 +1397,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, ...@@ -1397,6 +1397,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
int fifosize, base_baud; int fifosize, base_baud;
int port_type; int port_type;
struct pch_uart_driver_data *board; struct pch_uart_driver_data *board;
const char *board_name;
board = &drv_dat[id->driver_data]; board = &drv_dat[id->driver_data];
port_type = board->port_type; port_type = board->port_type;
...@@ -1412,7 +1413,8 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev, ...@@ -1412,7 +1413,8 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
base_baud = 1843200; /* 1.8432MHz */ base_baud = 1843200; /* 1.8432MHz */
/* quirk for CM-iTC board */ /* quirk for CM-iTC board */
if (strstr(dmi_get_system_info(DMI_BOARD_NAME), "CM-iTC")) board_name = dmi_get_system_info(DMI_BOARD_NAME);
if (board_name && strstr(board_name, "CM-iTC"))
base_baud = 192000000; /* 192.0MHz */ base_baud = 192000000; /* 192.0MHz */
switch (port_type) { switch (port_type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment