diff options
author | Liang He <windhl@126.com> | 2023-01-05 09:10:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-03-11 18:40:15 +0300 |
commit | 754e81ff44061dda68da0fd4ef51bd1aa9fbf2cf (patch) | |
tree | de7163619d420b46bce80c8ff3aa11183e6ac743 | |
parent | 903b91cea77acc79a6b58553023d6ea4d0aa3dd7 (diff) | |
download | linux-754e81ff44061dda68da0fd4ef51bd1aa9fbf2cf.tar.xz |
mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
[ Upstream commit 4414a7ab80cebf715045e3c4d465feefbad21139 ]
In arizona_clk32k_enable(), we should use pm_runtime_resume_and_get()
as pm_runtime_get_sync() will increase the refcnt even when it
returns an error.
Signed-off-by: Liang He <windhl@126.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230105061055.1509261-1-windhl@126.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/mfd/arizona-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 000cb82023e3..afdc49083625 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -45,7 +45,7 @@ int arizona_clk32k_enable(struct arizona *arizona) if (arizona->clk32k_ref == 1) { switch (arizona->pdata.clk32k_src) { case ARIZONA_32KZ_MCLK1: - ret = pm_runtime_get_sync(arizona->dev); + ret = pm_runtime_resume_and_get(arizona->dev); if (ret != 0) goto err_ref; ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]); |