diff mbox

pinctrl: intel: unlock on error in intel_config_set_pull()

Message ID 20170207132008.GD31552@mwanda
State New
Headers show

Commit Message

Dan Carpenter Feb. 7, 2017, 1:20 p.m. UTC
We need to unlock before returning -EINVAL on this error path.

Fixes: 04cc058f0c52 ("pinctrl: intel: Add support for 1k additional pull-down")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Linus Walleij Feb. 13, 2017, 2:42 p.m. UTC | #1
On Tue, Feb 7, 2017 at 2:20 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:

> We need to unlock before returning -EINVAL on this error path.
>
> Fixes: 04cc058f0c52 ("pinctrl: intel: Add support for 1k additional pull-down")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Patch applied as obviously correct.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 523264463d35..592b465e981e 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -599,8 +599,10 @@  static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin,
 			value |= PADCFG1_TERM_5K << PADCFG1_TERM_SHIFT;
 			break;
 		case 1000:
-			if (!(community->features & PINCTRL_FEATURE_1K_PD))
-				return -EINVAL;
+			if (!(community->features & PINCTRL_FEATURE_1K_PD)) {
+				ret = -EINVAL;
+				break;
+			}
 			value |= PADCFG1_TERM_1K << PADCFG1_TERM_SHIFT;
 			break;
 		default: