Merge "pinctrl: qcom: spmi-gpio: Correct power_source range check"

This commit is contained in:
Linux Build Service Account 2016-09-11 23:19:15 -07:00 committed by Gerrit - the friendly Code Review server
commit ef33877be2

View file

@ -505,7 +505,7 @@ static int pmic_gpio_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
pad->is_enabled = false; pad->is_enabled = false;
break; break;
case PIN_CONFIG_POWER_SOURCE: case PIN_CONFIG_POWER_SOURCE:
if (arg > pad->num_sources) if (arg >= pad->num_sources)
return -EINVAL; return -EINVAL;
pad->power_source = arg; pad->power_source = arg;
break; break;