arch/arm/src/s32k3xx: Fix incorrect check for invalid port or pin number
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
This commit is contained in:
parent
99109b8d79
commit
6aae7ba0eb
|
@ -70,7 +70,7 @@ int s32k3xx_pinconfig(uint32_t cfgset)
|
||||||
|
|
||||||
DEBUGASSERT(port < S32K3XX_NPORTS);
|
DEBUGASSERT(port < S32K3XX_NPORTS);
|
||||||
DEBUGASSERT(pin < S32K3XX_NPINS);
|
DEBUGASSERT(pin < S32K3XX_NPINS);
|
||||||
if ((port >= S32K3XX_NPORTS) && (pin >= S32K3XX_NPINS))
|
if ((port >= S32K3XX_NPORTS) || (pin >= S32K3XX_NPINS))
|
||||||
{
|
{
|
||||||
return -EINVAL; /* Invalid port or pin number */
|
return -EINVAL; /* Invalid port or pin number */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue