diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-01-24 17:28:22 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-01-30 09:15:10 +0100 |
commit | 19b26d92dfb70f56440c187a20c49102ab648b97 (patch) | |
tree | ac8e7b467d2a95234419611e0bf8dc9291e04c47 | |
parent | 2154d94b40ea2a5de05245521371d0461bb0d669 (diff) | |
download | op-kernel-dev-19b26d92dfb70f56440c187a20c49102ab648b97.zip op-kernel-dev-19b26d92dfb70f56440c187a20c49102ab648b97.tar.gz |
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c index b218961..4d4ef42 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, unsigned int i; int ret; + if (!mrfld_buf_available(mp, pin)) + return -ENOTSUPP; + for (i = 0; i < nconfigs; i++) { switch (pinconf_to_config_param(configs[i])) { case PIN_CONFIG_BIAS_DISABLE: |