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>
This commit is contained in:
Bora Guvendik 2018-10-05 12:33:53 -07:00 committed by Patrick Georgi
parent a07efab72a
commit a08475e9ab
1 changed files with 2 additions and 1 deletions

View File

@ -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++) {