pinctrl: core: Remove extra kref_get which blocks hogs being freed
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Fri, 28 Feb 2020 15:41:42 +0000 (15:41 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Mar 2020 06:14:23 +0000 (07:14 +0100)
commitc62016bdc2da958b22b61979f742edf094d5955a
treeddafef81d01ac94dfee5ea96bd1ea2950a42f155
parente0e86d976a14940440b88737916887576c9cee10
pinctrl: core: Remove extra kref_get which blocks hogs being freed

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 <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200228154142.13860-1-ckeepax@opensource.cirrus.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/core.c