Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp457727rwl; Wed, 4 Jan 2023 23:03:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfiXr7t0aO0O4Cx8TRPTfgF/xT51m1w6dI+KO92lfS/Hd1RRodS5SnDeZaJ9aFprrAtZ9K X-Received: by 2002:aa7:c659:0:b0:48c:7e42:844c with SMTP id z25-20020aa7c659000000b0048c7e42844cmr13810540edr.10.1672902229680; Wed, 04 Jan 2023 23:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672902229; cv=none; d=google.com; s=arc-20160816; b=iY+OG0WZFT1RjutrXrwHcwXJbee/2XyPXv5eu4WRKugXvN8vRJRt2fvtcCSB1NKFt8 bZ55669v7dtEBqBaQ42txaMKEURUYjX79Gu5M84cZR7q052McyqKoOHkeCwEe8bgcH7r PMxpo/er0ViPVJA170JA6rAN7yrZKnRCPA0+5OZrb5umj0XwsZXkk/kusgyMVrkHehKe yDsnml1qLlgET6RHtUHe8E24bC8ZwqpFLgNDpdUK21xePbJogaeWpaRdObw+PEQ6wlM3 u40sRm6PGBr+Z/dThoiAhGB/B0HTGOgDGV8XRgGIAnC2Guy9lApaw5rH6Vc5AQn3141k AGag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+CTu0102GyOYgF0oKjGnxfGyVDGf5Sg9WI0zhsJQK00=; b=xI05It+/UZVzh/h71O1ONhQSnIt/fPQs9aBmXhgmq/O6fwIoGZP67wYJ6W/RpmmQnx h8Vo5Iwk2LeQwPseWrNQYvRWTkcpxjLOfeVh28z/IsZaC4ZEN3cohojZAesnTDm3cJ+3 VJntjX2SI0WcM+8E1R8PXWGQI6y374BrEWbWRqjMpkN9BOXP7oCYFH/yVSBBDOjswRYl QZ9iw2ft8EhLAmyyHMXbGS5SG8O3dtbW9ESCrAo61PArLRzQvQQLrtSZSeCLfJ1SgOeu uewNj/slQUhtTJbmCDSFLj4pkInDxf4MZvoqmB8B9SL7NFdSWyryVCCU2b8FuhiLgt3+ l9Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b="N/uffnJb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a05640234c100b0047f9f11dab3si34817652edc.25.2023.01.04.23.03.34; Wed, 04 Jan 2023 23:03:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b="N/uffnJb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230369AbjAEGlZ (ORCPT + 55 others); Thu, 5 Jan 2023 01:41:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjAEGlX (ORCPT ); Thu, 5 Jan 2023 01:41:23 -0500 X-Greylist: delayed 1808 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 04 Jan 2023 22:41:20 PST Received: from m126.mail.126.com (m126.mail.126.com [123.126.96.241]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25FB530575 for ; Wed, 4 Jan 2023 22:41:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=+CTu0 102GyOYgF0oKjGnxfGyVDGf5Sg9WI0zhsJQK00=; b=N/uffnJb3jesSZ6MbdXyP nvzvyhOFdRHbl9X3t34j5z1h9glaSMcUGeegsJNaCtKI9VG2Y+EEbyAB1M8ES13I RqQJu8Q0pVd+OMVtjhGlkulQk5qjDCTRMXbjzC0mVARAdzn2ejxeyYAfHC3zpg/1 48kbr8pkwlmc2wjq8HCDXo= Received: from localhost.localdomain (unknown [124.16.139.61]) by smtp14 (Coremail) with SMTP id fuRpCgBXGZnyabZjSb09AA--.36535S2; Thu, 05 Jan 2023 14:10:59 +0800 (CST) From: Liang He To: lee@kernel.org, ckeepax@opensource.cirrus.com, patches@opensource.cirrus.com, windhl@126.com Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2] mfd: arizona: Use pm_runtime_resume_and_get() to prevent refcnt leak Date: Thu, 5 Jan 2023 14:10:55 +0800 Message-Id: <20230105061055.1509261-1-windhl@126.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: fuRpCgBXGZnyabZjSb09AA--.36535S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrKw1fury8trWrZFyUJF45Awb_yoWfKFc_Ca 98Wr43Cr4Fgrn7Ka1xX3yFv34IkFy8XF43Zw4vvFy3JF4jka17XryDXFyDArnrZ3y5AF90 gr4qyryfZ3Z8ujkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRWE__7UUUUU== X-Originating-IP: [124.16.139.61] X-CM-SenderInfo: hzlqvxbo6rjloofrz/1tbi5hPtF2Ixk+pFKwAAsL X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- changelog: v1: add missing pm_runtime_put_sync() v2: use pm_runtime_resume_and_get() 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 cbf1dd90b70d..b1c53e040771 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.25.1