summaryrefslogtreecommitdiff
path: root/drivers/misc/pch_phub.c
diff options
context:
space:
mode:
authorAlexander Stein <alexander.stein@systec-electronic.com>2011-07-25 17:11:54 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 20:57:07 -0700
commit2b934c6236983392d01bef22e43af3051cac16f5 (patch)
treec7901f1c9392f8ebb99f0cfda871863e0c2d5500 /drivers/misc/pch_phub.c
parent90b03f5052be92ab0ba0aa36abcf33a207706866 (diff)
downloadlwn-2b934c6236983392d01bef22e43af3051cac16f5.tar.gz
lwn-2b934c6236983392d01bef22e43af3051cac16f5.zip
drivers/misc/pch_phub.c: don't oops if dmi_get_system_info returns NULL
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 <alexander.stein@systec-electronic.com> Cc: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> Cc: Greg KH <gregkh@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/pch_phub.c')
-rw-r--r--drivers/misc/pch_phub.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 5fe79df44838..01eb67b4871a 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -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)
@@ -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 |