Bora Guvendik has uploaded this change for review.

View Change

soc/intel/common/block/gpio: check for NULL using if statement

Remove assert() and instead use if statement to check if
comm->groups is NULL.

Found-by: klockwork

BUG=None
TEST=Boot to OS

Change-Id: I85a6bc700b52d04c61ca8f2baac62000f40cf2cb
Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
---
M src/soc/intel/common/block/gpio/gpio.c
1 file changed, 4 insertions(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/28940/1
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 931fb7f..38d846c 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -73,7 +73,10 @@
{
size_t i;

- assert(comm->groups != NULL);
+ if (!comm->groups) {
+ printk(BIOS_ERR, "%s: Failed to get comm->groups\n", __func__);
+ return 0;
+ }

/* find the base pad number for this pad's group */
for (i = 0; i < comm->num_groups; i++) {

To view, visit change 28940. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85a6bc700b52d04c61ca8f2baac62000f40cf2cb
Gerrit-Change-Number: 28940
Gerrit-PatchSet: 1
Gerrit-Owner: Bora Guvendik <bora.guvendik@intel.com>