[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230301162957.1303086-5-sashal@kernel.org>
Date: Wed, 1 Mar 2023 11:29:57 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Liang He <windhl@....com>,
Charles Keepax <ckeepax@...nsource.cirrus.com>,
Lee Jones <lee@...nel.org>, Sasha Levin <sashal@...nel.org>,
patches@...nsource.cirrus.com
Subject: [PATCH AUTOSEL 5.10 5/5] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
From: Liang He <windhl@....com>
[ 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@....com>
Acked-by: Charles Keepax <ckeepax@...nsource.cirrus.com>
Signed-off-by: Lee Jones <lee@...nel.org>
Link: https://lore.kernel.org/r/20230105061055.1509261-1-windhl@126.com
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/mfd/arizona-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 000cb82023e35..afdc490836255 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]);
--
2.39.2
Powered by blists - more mailing lists