soc/intel/skylake: Fix ‘dev’ pointer NULL before being dereferenced

This patch fixes KW issue due to pointer being NULL and will be dereferenced

Change-Id: Iedb59daf5f448e31c0097873a086e4d08cd4a979
Signed-off-by: Subrata Banik <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/28948
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Subrata Banik 2018-10-06 13:58:33 +05:30 committed by Aaron Durbin
parent f7cc469139
commit 834543c0c7
2 changed files with 8 additions and 0 deletions

View File

@ -290,6 +290,10 @@ static void configure_isst(void)
static void configure_misc(void) static void configure_misc(void)
{ {
struct device *dev = SA_DEV_ROOT; struct device *dev = SA_DEV_ROOT;
if (!dev) {
printk(BIOS_ERR, "SA_DEV_ROOT device not found!\n");
return;
}
config_t *conf = dev->chip_info; config_t *conf = dev->chip_info;
msr_t msr; msr_t msr;

View File

@ -83,6 +83,10 @@ void pch_thermal_configuration(void)
{ {
uint16_t reg16; uint16_t reg16;
struct device *dev = PCH_DEV_THERMAL; struct device *dev = PCH_DEV_THERMAL;
if (!dev) {
printk(BIOS_ERR, "PCH_DEV_THERMAL device not found!\n");
return;
}
void *thermalbar = pch_thermal_get_bar(dev); void *thermalbar = pch_thermal_get_bar(dev);
/* Use default pre-ram bar */ /* Use default pre-ram bar */