Skip to contentSkip to conversation

pinctrl: off by one in msm_config_group_set()

PATCH In review Dan Carpenter 2 participants 2 messages Dec 16, 2013 – Dec 20, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: off by one in msm_config_group_set()

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

Fixes f365be092572 ('pinctrl: Add Qualcomm TLMM driver')
drivers/pinctrl/pinctrl-msm.c +1 -1
index 28b90aba708d..03c4e615ebb8 100644
@@ -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];
#1 lore raw
Quoted 4 lines · Dan Carpenter

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

Fixes f365be092572 ('pinctrl: Add Qualcomm TLMM driver')

This appears to be fixed already by one of Björn's follow-up patches, so dropping this patch.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html