summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBora Guvendik <bora.guvendik@intel.com>2018-10-05 12:33:53 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-10-11 09:24:01 +0000
commita08475e9abe48393453560a7bdd9ffc040be7845 (patch)
treed10d4c5f963c2000d89f16332c50a404be4acc6e /src
parenta07efab72a6e4a44e8a3ad92a71b569e1f269426 (diff)
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> Reviewed-on: https://review.coreboot.org/28940 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/common/block/gpio/gpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 931fb7f545..bd124775b6 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -73,7 +73,8 @@ static inline size_t gpio_group_index(const struct pad_community *comm,
{
size_t i;
- assert(comm->groups != NULL);
+ if (!comm->groups)
+ die("Failed to get comm->groups.");
/* find the base pad number for this pad's group */
for (i = 0; i < comm->num_groups; i++) {