blob: 3eeef31c2ae4aa05abd66c419e64db5cb60fca90 [file] [log] [blame]
From 01116bf5bc5dcfc020389a2d29926bda4a42d943 Mon Sep 17 00:00:00 2001
From: Charles Keepax <>
Date: Fri, 28 Feb 2020 15:41:42 +0000
Subject: [PATCH] pinctrl: core: Remove extra kref_get which blocks hogs being
commit aafd56fc79041bf36f97712d4b35208cbe07db90 upstream.
kref_init starts with the reference count at 1, which will be balanced
by the pinctrl_put in pinctrl_unregister. The additional kref_get in
pinctrl_claim_hogs will increase this count to 2 and cause the hogs to
not get freed when pinctrl_unregister is called.
Fixes: 6118714275f0 ("pinctrl: core: Fix pinctrl_register_and_init() with pinctrl_enable()")
Signed-off-by: Charles Keepax <>
Signed-off-by: Linus Walleij <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index a64849a9d1b0..9807ff04c649 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -2007,7 +2007,6 @@ static int pinctrl_claim_hogs(struct pinctrl_dev *pctldev)
return PTR_ERR(pctldev->p);
- kref_get(&pctldev->p->users);
pctldev->hog_default =
pinctrl_lookup_state(pctldev->p, PINCTRL_STATE_DEFAULT);
if (IS_ERR(pctldev->hog_default)) {