<p>Bora Guvendik has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/28940">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">soc/intel/common/block/gpio: check for NULL using if statement<br><br>Remove assert() and instead use if statement to check if<br>comm->groups is NULL.<br><br>Found-by: klockwork<br><br>BUG=None<br>TEST=Boot to OS<br><br>Change-Id: I85a6bc700b52d04c61ca8f2baac62000f40cf2cb<br>Signed-off-by: Bora Guvendik <bora.guvendik@intel.com><br>---<br>M src/soc/intel/common/block/gpio/gpio.c<br>1 file changed, 4 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/28940/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c</span><br><span>index 931fb7f..38d846c 100644</span><br><span>--- a/src/soc/intel/common/block/gpio/gpio.c</span><br><span>+++ b/src/soc/intel/common/block/gpio/gpio.c</span><br><span>@@ -73,7 +73,10 @@</span><br><span> {</span><br><span>   size_t i;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   assert(comm->groups != NULL);</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!comm->groups) {</span><br><span style="color: hsl(120, 100%, 40%);">+               printk(BIOS_ERR, "%s: Failed to get comm->groups\n", __func__);</span><br><span style="color: hsl(120, 100%, 40%);">+          return 0;</span><br><span style="color: hsl(120, 100%, 40%);">+     }</span><br><span> </span><br><span>        /* find the base pad number for this pad's group */</span><br><span>      for (i = 0; i < comm->num_groups; i++) {</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/28940">change 28940</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/28940"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I85a6bc700b52d04c61ca8f2baac62000f40cf2cb </div>
<div style="display:none"> Gerrit-Change-Number: 28940 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Bora Guvendik <bora.guvendik@intel.com> </div>