aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-01-24 10:28:22 -0500
committerLinus Walleij <linus.walleij@linaro.org>2017-01-30 03:15:10 -0500
commit19b26d92dfb70f56440c187a20c49102ab648b97 (patch)
treeac8e7b467d2a95234419611e0bf8dc9291e04c47
parent2154d94b40ea2a5de05245521371d0461bb0d669 (diff)
pinctrl: intel: merrifield: Add missed check in mrfld_config_set()
Not every pin can be configured. Add missed check to prevent access violation. Fixes: 4e80c8f50574 ("pinctrl: intel: Add Intel Merrifield pin controller support") Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/intel/pinctrl-merrifield.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c
index b21896126f76..4d4ef42a39b5 100644
--- a/drivers/pinctrl/intel/pinctrl-merrifield.c
+++ b/drivers/pinctrl/intel/pinctrl-merrifield.c
@@ -794,6 +794,9 @@ static int mrfld_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
794 unsigned int i; 794 unsigned int i;
795 int ret; 795 int ret;
796 796
797 if (!mrfld_buf_available(mp, pin))
798 return -ENOTSUPP;
799
797 for (i = 0; i < nconfigs; i++) { 800 for (i = 0; i < nconfigs; i++) {
798 switch (pinconf_to_config_param(configs[i])) { 801 switch (pinconf_to_config_param(configs[i])) {
799 case PIN_CONFIG_BIAS_DISABLE: 802 case PIN_CONFIG_BIAS_DISABLE: