[patch] pinctrl: off by one in msm_config_group_set()
From: Dan Carpenter
Date: Mon Dec 16 2013 - 05:42:44 EST
This should be ">= ARRAY_SIZE()" instead of "> ARRAY_SIZE()".
Fixes: f365be092572 ('pinctrl: Add Qualcomm TLMM driver')
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/