* [PATCH] pinctrl: sunxi: drop lock on error path
@ 2013-08-29 17:19 Linus Walleij
2013-08-29 17:35 ` Sherman Yin
2013-08-30 7:52 ` Maxime Ripard
0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2013-08-29 17:19 UTC (permalink / raw)
To: linux-arm-kernel
I forgot to drop the lock for the return inside the loop
protected by the spinlock in the pin config routine when
merging in -rc7 in commit 6ad30ce046aefbdc3848232c665a728860d7bb68
Reported-by: Sherman Yin <syin@broadcom.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/pinctrl/pinctrl-sunxi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index 532202b..4432e5e 100644
--- a/drivers/pinctrl/pinctrl-sunxi.c
+++ b/drivers/pinctrl/pinctrl-sunxi.c
@@ -291,8 +291,10 @@ static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev,
switch (pinconf_to_config_param(configs[i])) {
case PIN_CONFIG_DRIVE_STRENGTH:
strength = pinconf_to_config_argument(configs[i]);
- if (strength > 40)
+ if (strength > 40) {
+ spin_unlock_irqrestore(&pctl->lock, flags);
return -EINVAL;
+ }
/*
* We convert from mA to what the register expects:
* 0: 10mA
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] pinctrl: sunxi: drop lock on error path
2013-08-29 17:19 [PATCH] pinctrl: sunxi: drop lock on error path Linus Walleij
@ 2013-08-29 17:35 ` Sherman Yin
2013-08-30 7:52 ` Maxime Ripard
1 sibling, 0 replies; 3+ messages in thread
From: Sherman Yin @ 2013-08-29 17:35 UTC (permalink / raw)
To: linux-arm-kernel
>@@ -291,8 +291,10 @@ static int sunxi_pconf_group_set(struct pinctrl_dev
>*pctldev,
> switch (pinconf_to_config_param(configs[i])) {
> case PIN_CONFIG_DRIVE_STRENGTH:
> strength = pinconf_to_config_argument(configs[i]);
>- if (strength > 40)
>+ if (strength > 40) {
>+ spin_unlock_irqrestore(&pctl->lock, flags);
> return -EINVAL;
>+ }
> /*
> * We convert from mA to what the register expects:
> * 0: 10mA
Looks good.
Regards,
Sherman
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH] pinctrl: sunxi: drop lock on error path
2013-08-29 17:19 [PATCH] pinctrl: sunxi: drop lock on error path Linus Walleij
2013-08-29 17:35 ` Sherman Yin
@ 2013-08-30 7:52 ` Maxime Ripard
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2013-08-30 7:52 UTC (permalink / raw)
To: linux-arm-kernel
Hi Linus,
On Thu, Aug 29, 2013 at 07:19:44PM +0200, Linus Walleij wrote:
> I forgot to drop the lock for the return inside the loop
> protected by the spinlock in the pin config routine when
> merging in -rc7 in commit 6ad30ce046aefbdc3848232c665a728860d7bb68
>
> Reported-by: Sherman Yin <syin@broadcom.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130830/b399863f/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-08-30 7:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-29 17:19 [PATCH] pinctrl: sunxi: drop lock on error path Linus Walleij
2013-08-29 17:35 ` Sherman Yin
2013-08-30 7:52 ` Maxime Ripard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).