[coreboot-gerrit] Change in coreboot[master]: soc/intel/common/block/gpio: check for NULL using if statement

Bora Guvendik (Code Review) gerrit at coreboot.org
Fri Oct 5 21:57:13 CEST 2018


Bora Guvendik has uploaded this change for review. ( https://review.coreboot.org/28940


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

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 at 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 https://review.coreboot.org/28940
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: I85a6bc700b52d04c61ca8f2baac62000f40cf2cb
Gerrit-Change-Number: 28940
Gerrit-PatchSet: 1
Gerrit-Owner: Bora Guvendik <bora.guvendik at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181005/7ae081df/attachment.html>


More information about the coreboot-gerrit mailing list