Skip to content

Commit

Permalink
drivers/misc/pch_phub.c: don't oops if dmi_get_system_info returns NULL
Browse files Browse the repository at this point in the history
If dmi_get_system_info() returns NULL, pch_phub_probe() will dereferencea
a zero pointer.

This oops was observed on an Atom based board which has no BIOS, but a
bootloder which doesn't privde DMI data.

Signed-off-by: Alexander Stein <[email protected]>
Cc: Tomoya MORINAGA <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Alexander Stein authored and torvalds committed Jul 26, 2011
1 parent 90b03f5 commit 2b934c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/misc/pch_phub.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
}

if (id->driver_data == 1) { /* EG20T PCH */
const char *board_name;

retval = sysfs_create_file(&pdev->dev.kobj,
&dev_attr_pch_mac.attr);
if (retval)
Expand All @@ -701,7 +703,8 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
CLKCFG_CANCLK_MASK);

/* 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"))
pch_phub_read_modify_write_reg(chip,
(unsigned int)CLKCFG_REG_OFFSET,
CLKCFG_UART_48MHZ | CLKCFG_BAUDDIV |
Expand Down

0 comments on commit 2b934c6

Please sign in to comment.