This should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".

Fixes: f365be092572 ('pinctrl: Add Qualcomm TLMM driver')
Signed-off-by: Dan Carpenter <[email protected]>

diff --git a/drivers/pinctrl/pinctrl-msm.c b/drivers/pinctrl/pinctrl-msm.c
index 28b90aba708d..03c4e615ebb8 100644
--- a/drivers/pinctrl/pinctrl-msm.c
+++ b/drivers/pinctrl/pinctrl-msm.c
@@ -350,7 +350,7 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev,
                        break;
                case PIN_CONFIG_DRIVE_STRENGTH:
                        /* Check for invalid values */
-                       if (arg > ARRAY_SIZE(msm_drive_to_regval))
+                       if (arg >= ARRAY_SIZE(msm_drive_to_regval))
                                arg = -1;
                        else
                                arg = msm_drive_to_regval[arg];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to