]> git.itanic.dy.fi Git - linux-stable/commitdiff
mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak
authorLiang He <windhl@126.com>
Thu, 5 Jan 2023 06:10:55 +0000 (14:10 +0800)
committerLee Jones <lee@kernel.org>
Wed, 22 Feb 2023 08:25:53 +0000 (08:25 +0000)
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
drivers/mfd/arizona-core.c

index bd7ee3260d53f697c63620679a0630c2633d16c6..c166fcd331f113c157749f6f2ea3fa020767db77 100644 (file)
@@ -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]);