Commit 19b26d92 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: intel: merrifield: Add missed check in mrfld_config_set()

Not every pin can be configured. Add missed check to prevent access
violation.

Fixes: 4e80c8f5 ("pinctrl: intel: Add Intel Merrifield pin controller support")
Acked-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 2154d94b
...@@ -794,6 +794,9 @@ static int mrfld_config_set(struct pinctrl_dev *pctldev, unsigned int pin, ...@@ -794,6 +794,9 @@ static int mrfld_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
unsigned int i; unsigned int i;
int ret; int ret;
if (!mrfld_buf_available(mp, pin))
return -ENOTSUPP;
for (i = 0; i < nconfigs; i++) { for (i = 0; i < nconfigs; i++) {
switch (pinconf_to_config_param(configs[i])) { switch (pinconf_to_config_param(configs[i])) {
case PIN_CONFIG_BIAS_DISABLE: case PIN_CONFIG_BIAS_DISABLE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment