diff mbox

pinctrl: rockchip: missing unlock on error in rockchip_set_pull()

Message ID 20131114082254.GE8150@elgon.mountain (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter Nov. 14, 2013, 8:22 a.m. UTC
We need to unlock here before returning -EINVAL.

Fixes: 6ca5274d1d12 ('pinctrl: rockchip: add rk3188 specifics')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Heiko Stübner Nov. 14, 2013, 3:51 p.m. UTC | #1
Am Donnerstag, 14. November 2013, 09:22:54 schrieb Dan Carpenter:
> We need to unlock here before returning -EINVAL.

I seem to say this a lot recently: thanks for the catch :-)


> Fixes: 6ca5274d1d12 ('pinctrl: rockchip: add rk3188 specifics')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Heiko Stuebner <heiko@sntech.de>


> diff --git a/drivers/pinctrl/pinctrl-rockchip.c
> b/drivers/pinctrl/pinctrl-rockchip.c index e939c28..bfd1824 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -504,6 +504,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank
> *bank, data |= (3 << bit);
>  			break;
>  		default:
> +			spin_unlock_irqrestore(&bank->slock, flags);
>  			dev_err(info->dev, "unsupported pull setting %d\n",
>  				pull);
>  			return -EINVAL;
Linus Walleij Nov. 19, 2013, 8:39 a.m. UTC | #2
On Thu, Nov 14, 2013 at 9:22 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:

> We need to unlock here before returning -EINVAL.
>
> Fixes: 6ca5274d1d12 ('pinctrl: rockchip: add rk3188 specifics')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied with Heiko's ACK.

Thanks!
Linus Walleij
diff mbox

Patch

diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index e939c28..bfd1824 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -504,6 +504,7 @@  static int rockchip_set_pull(struct rockchip_pin_bank *bank,
 			data |= (3 << bit);
 			break;
 		default:
+			spin_unlock_irqrestore(&bank->slock, flags);
 			dev_err(info->dev, "unsupported pull setting %d\n",
 				pull);
 			return -EINVAL;