diff options
author | Subrata Banik <subrata.banik@intel.com> | 2018-10-06 13:58:33 +0530 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2018-10-08 14:49:18 +0000 |
commit | 834543c0c71544b547194b093b8e1da990722762 (patch) | |
tree | a29715edfc6d394fbce409dec593eaca0983d5b3 /src/soc/intel/skylake | |
parent | f7cc469139741fd30b8f1195528060b3677d63bc (diff) | |
download | coreboot-834543c0c71544b547194b093b8e1da990722762.tar.xz |
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>
Diffstat (limited to 'src/soc/intel/skylake')
-rw-r--r-- | src/soc/intel/skylake/cpu.c | 4 | ||||
-rw-r--r-- | src/soc/intel/skylake/thermal.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c index 3733fe000c..7a66ed0e33 100644 --- a/src/soc/intel/skylake/cpu.c +++ b/src/soc/intel/skylake/cpu.c @@ -290,6 +290,10 @@ static void configure_isst(void) static void configure_misc(void) { 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; msr_t msr; diff --git a/src/soc/intel/skylake/thermal.c b/src/soc/intel/skylake/thermal.c index 01a4f26259..c1b4ce31d4 100644 --- a/src/soc/intel/skylake/thermal.c +++ b/src/soc/intel/skylake/thermal.c @@ -83,6 +83,10 @@ void pch_thermal_configuration(void) { uint16_t reg16; 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); /* Use default pre-ram bar */ |