[coreboot-gerrit] Change in coreboot[master]: intel/common/block: Fix issues found by klockwork

John Zhao (Code Review) gerrit at coreboot.org
Sat Aug 11 00:23:04 CEST 2018


John Zhao has uploaded this change for review. ( https://review.coreboot.org/28019


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: Ia79d6c08c3b75dfd638a75563fb06a4916b7b218
Signed-off-by: John Zhao <john.zhao at intel.com>
---
M 3rdparty/blobs
M src/soc/intel/common/block/cpu/mp_init.c
M src/soc/intel/common/block/graphics/graphics.c
3 files changed, 7 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/28019/1

diff --git a/3rdparty/blobs b/3rdparty/blobs
index 372012e..c285102 160000
--- a/3rdparty/blobs
+++ b/3rdparty/blobs
@@ -1 +1 @@
-Subproject commit 372012e8e1d0d01f3e77ff73b118665b41ff68b6
+Subproject commit c2851026e72dcb7b8c1d19e750c0416a6abf41ce
diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c
index 89c95a4..64d262d 100644
--- a/src/soc/intel/common/block/cpu/mp_init.c
+++ b/src/soc/intel/common/block/cpu/mp_init.c
@@ -125,14 +125,16 @@
 {
 	struct device *dev = dev_find_path(NULL, DEVICE_PATH_CPU_CLUSTER);
 	assert(dev != NULL);
-
+	DEVTREE_CONST struct bus *bus = dev->link_list;
+	assert(bus != NULL);
+	
 	if (chip_get_fsp_mp_init())
 		return;
 
 	microcode_patch = intel_microcode_find();
 	intel_microcode_load_unlocked(microcode_patch);
 
-	soc_init_cpus(dev->link_list);
+	soc_init_cpus(bus);
 }
 
 static void wrapper_x86_setup_mtrrs(void *unused)
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)

-- 
To view, visit https://review.coreboot.org/28019
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia79d6c08c3b75dfd638a75563fb06a4916b7b218
Gerrit-Change-Number: 28019
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180810/f5efe783/attachment-0001.html>


More information about the coreboot-gerrit mailing list