John Zhao has uploaded this change for review. ( https://review.coreboot.org/28060
Change subject: intel/common/block: Fix issues found by klockwork ......................................................................
intel/common/block: Fix issues found by klockwork
src/soc/intel/common/block/cpu/mp_init.c Function init_cpus: Pointer dev checked for NULL may be deferenced.
src/soc/intel/common/block/graphics/graphics.c Function graphics_get_bar: Pointer dev returned from call may be NULL and will be deferenced.
BRANCH=None TEST=Built & booted Yorp board.
Change-Id: I5e7caa15a3911e05ff346d338493673af5318a51 Signed-off-by: John Zhao john.zhao@intel.com --- M src/soc/intel/common/block/cpu/mp_init.c M src/soc/intel/common/block/graphics/graphics.c 2 files changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/28060/1
diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c index f52709d..b233715 100644 --- a/src/soc/intel/common/block/cpu/mp_init.c +++ b/src/soc/intel/common/block/cpu/mp_init.c @@ -134,6 +134,7 @@ microcode_patch = intel_microcode_find(); intel_microcode_load_unlocked(microcode_patch);
+ assert(dev->link_list != NULL); soc_init_cpus(dev->link_list); }
diff --git a/src/soc/intel/common/block/graphics/graphics.c b/src/soc/intel/common/block/graphics/graphics.c index c6ea7e2..022cb48 100644 --- a/src/soc/intel/common/block/graphics/graphics.c +++ b/src/soc/intel/common/block/graphics/graphics.c @@ -15,6 +15,7 @@ */
#include <compiler.h> +#include <assert.h> #include <console/console.h> #include <device/pci.h> #include <device/pci_ids.h> @@ -36,6 +37,7 @@ { struct device *dev = SA_DEV_IGD; struct resource *gm_res; + assert(dev != NULL);
/* Check if Graphics PCI device is disabled */ if (!dev->enabled)