From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 166FF882B for ; Fri, 10 Mar 2023 15:08:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78D57C433D2; Fri, 10 Mar 2023 15:08:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678460889; bh=Chnp21lNTbti4+QpZwYJmax4JuYhB1+wZu/rdkonZk4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WBRErWYpm3BGMAxGpzYNqyw4IIXY4umLmOne+z0fvmOnEKi6eaMs5algxXMW/F5tI 7x95YZOGk8ji0EttVmk4NgwzY+rSMb76k3pAfplAGA87dIwcilVbaqG/K2MsdYL+75 4XKyvnGt0PzYAHnoEgGgufHVSnxQ/zhf6/nFFaKg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Liang He , Charles Keepax , Lee Jones , Sasha Levin Subject: [PATCH 5.10 486/529] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak Date: Fri, 10 Mar 2023 14:40:29 +0100 Message-Id: <20230310133827.369705207@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230310133804.978589368@linuxfoundation.org> References: <20230310133804.978589368@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Liang He [ 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 Acked-by: Charles Keepax Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20230105061055.1509261-1-windhl@126.com Signed-off-by: Sasha Levin --- 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