[coreboot-gerrit] Change in coreboot[master]: intel/common/block: Fix issues found by klockwork
John Zhao (Code Review)
gerrit at coreboot.org
Mon Aug 13 18:48:09 CEST 2018
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 at 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)
--
To view, visit https://review.coreboot.org/28060
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: I5e7caa15a3911e05ff346d338493673af5318a51
Gerrit-Change-Number: 28060
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/20180813/00796ac3/attachment-0001.html>
More information about the coreboot-gerrit
mailing list