Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/21404
Change subject: soc/intel/{cannonlake,skylake}: Fix klocwork issue ......................................................................
soc/intel/{cannonlake,skylake}: Fix klocwork issue
This patch fixes klocwork bug due to recent memmap.c implementation.
Change-Id: I4c74ca410d1a0ba48634ec9928a0d9d1cc20e27a Signed-off-by: Subrata Banik subrata.banik@intel.com --- M src/soc/intel/cannonlake/memmap.c M src/soc/intel/skylake/memmap.c 2 files changed, 4 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/21404/1
diff --git a/src/soc/intel/cannonlake/memmap.c b/src/soc/intel/cannonlake/memmap.c index 8f842c0..29f25f2 100644 --- a/src/soc/intel/cannonlake/memmap.c +++ b/src/soc/intel/cannonlake/memmap.c @@ -91,6 +91,8 @@ size_t imr_size;
dev = dev_find_slot(0, PCI_DEVFN(SA_DEV_SLOT_IGD, 0)); + if (!dev) + die("ERROR - device not found!");
/* Read TOLUD from Host Bridge offset */ dram_base = sa_get_tolud_base(); diff --git a/src/soc/intel/skylake/memmap.c b/src/soc/intel/skylake/memmap.c index 229afa7..6c64073 100644 --- a/src/soc/intel/skylake/memmap.c +++ b/src/soc/intel/skylake/memmap.c @@ -142,6 +142,8 @@ size_t prmrr_size;
dev = dev_find_slot(0, PCI_DEVFN(SA_DEV_SLOT_IGD, 0)); + if (!dev) + die("ERROR - device not found!");
/* Read TOLUD from Host Bridge offset */ dram_base = sa_get_tolud_base(); @@ -160,7 +162,6 @@ if (IS_ENABLED(CONFIG_SA_ENABLE_DPR)) dram_base -= sa_get_dpr_size();
- dev = dev_find_slot(0, PCI_DEVFN(SA_DEV_SLOT_ROOT, 0)); config = dev->chip_info; if (IS_ENABLED(CONFIG_PLATFORM_USES_FSP1_1)) prmrr_size = 1*MiB;