Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1703615 > unrolled thread
| Started by | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| First post | 2017-08-04 05:10 +0200 |
| Last post | 2017-08-07 15:30 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] pinctrl: check ops->pin_config_set in pinconf_set_config() Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-08-04 05:10 +0200
Re: [PATCH] pinctrl: check ops->pin_config_set in pinconf_set_config() Mika Westerberg <mika.westerberg@linux.intel.com> - 2017-08-04 12:20 +0200
Re: [PATCH] pinctrl: check ops->pin_config_set in pinconf_set_config() Linus Walleij <linus.walleij@linaro.org> - 2017-08-07 15:30 +0200
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2017-08-04 05:10 +0200 |
| Subject | [PATCH] pinctrl: check ops->pin_config_set in pinconf_set_config() |
| Message-ID | <uaB9T-1ha-1@gated-at.bofh.it> |
pinconf_set_config() is called by pinctrl_gpio_set_config().
If a GPIO driver is backed by a pinctrl driver and it does not
support .pin_config_set() hook, it causes NULL pointer dereference.
Fixes: 15381bc7c7f5 ("pinctrl: Allow configuration of pins from gpiolib based drivers")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
drivers/pinctrl/pinconf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 92f363793f35..d3fe14394b73 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -205,7 +205,7 @@ int pinconf_set_config(struct pinctrl_dev *pctldev, unsigned pin,
const struct pinconf_ops *ops;
ops = pctldev->desc->confops;
- if (!ops)
+ if (!ops || !ops->pin_config_set)
return -ENOTSUPP;
return ops->pin_config_set(pctldev, pin, configs, nconfigs);
--
2.7.4
[toc] | [next] | [standalone]
| From | Mika Westerberg <mika.westerberg@linux.intel.com> |
|---|---|
| Date | 2017-08-04 12:20 +0200 |
| Subject | Re: [PATCH] pinctrl: check ops->pin_config_set in pinconf_set_config() |
| Message-ID | <uaHS1-5H2-7@gated-at.bofh.it> |
| In reply to | #1703615 |
On Fri, Aug 04, 2017 at 11:59:32AM +0900, Masahiro Yamada wrote:
> pinconf_set_config() is called by pinctrl_gpio_set_config().
> If a GPIO driver is backed by a pinctrl driver and it does not
> support .pin_config_set() hook, it causes NULL pointer dereference.
>
> Fixes: 15381bc7c7f5 ("pinctrl: Allow configuration of pins from gpiolib based drivers")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
[toc] | [prev] | [next] | [standalone]
| From | Linus Walleij <linus.walleij@linaro.org> |
|---|---|
| Date | 2017-08-07 15:30 +0200 |
| Message-ID | <ubQgx-ju-5@gated-at.bofh.it> |
| In reply to | #1703615 |
On Fri, Aug 4, 2017 at 4:59 AM, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> pinconf_set_config() is called by pinctrl_gpio_set_config().
> If a GPIO driver is backed by a pinctrl driver and it does not
> support .pin_config_set() hook, it causes NULL pointer dereference.
>
> Fixes: 15381bc7c7f5 ("pinctrl: Allow configuration of pins from gpiolib based drivers")
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Patcg applied with Mika's ACK.
Yours,
Linus Walleij
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web