Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak

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

authored by

Liang He and committed by
Lee Jones
4414a7ab 7d1e3bd9

+1 -1
+1 -1
drivers/mfd/arizona-core.c
··· 45 45 if (arizona->clk32k_ref == 1) { 46 46 switch (arizona->pdata.clk32k_src) { 47 47 case ARIZONA_32KZ_MCLK1: 48 - ret = pm_runtime_get_sync(arizona->dev); 48 + ret = pm_runtime_resume_and_get(arizona->dev); 49 49 if (ret != 0) 50 50 goto err_ref; 51 51 ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);