From patchwork Mon Oct 24 11:30:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9665 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp534726wru; Mon, 24 Oct 2022 09:11:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM79l1UE6Dnpdma4yrmnGi4avpbKvn12fS0Hbw0v/38yS74fvPD4Fa39uoHNQy3iYoy7hHP2 X-Received: by 2002:a63:d845:0:b0:44b:d074:97d with SMTP id k5-20020a63d845000000b0044bd074097dmr29315666pgj.32.1666627899375; Mon, 24 Oct 2022 09:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666627899; cv=none; d=google.com; s=arc-20160816; b=09/4sOSGUxhA9DvHi1lxGb3x3ZCpc113dujF5uSKu+iJokQLfVcPP+Zl69KLL8ht5L Kyz1wP42U/yyyANhmPKPlJ/tbRh+BE7cY6nhThnfUB76vBBYp0YMjVoEwmPMiFlzcSM3 k60sZMRh5MpkN4TuBoCvXsnEgM8L8c5d/0s4PIvlmoh1oIBtHKLTNQNrjYt0iqvUp+Rn QLAT9BnkKfv9Ac1EtXyC4oH7UVzIy19zj8dMHbkmZYaLANkJgjwhigcAWmpiOUqbg+/E IsZkJV2y87l4MxN8fnAxkDOZAB8gcFgzOm2feOICksqqXjLiQWuq8rMWAxghW+03G+OR WfsA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LWy2XAGNA5ZZNgHXXcVrR1+HaYsbKEPO+cXv9RgMG4Q=; b=JDbJoxso42UfGXRoiZVkqE3RFib76/EYEILkQhNP/IctoJEbe3OYCOpMyPp0Gr5NaG USEG51uputfiAx0yvnL1e4/LVllzkmp7DYTzOg7JIflUR2FY9yQjnt3oL2bBJABadQKU mPZN4PUKeifG7kRNvotnWDydLKpQ/9TbSYP14+0G4ioPUCpnKhjG8v3h9fNK0S9Lp2+G hMdujyv294bBuk+yxJ6bJ0FFIINc94R0L6F5C2g26O4gzioV705AYB0APJ+iacmqB40O m1JM2IQDjUJS8+M7MKZUZonow5CkKZPiNNPRTIoCzQaS5eZJmXGJdphu0E1XkUCR//YG ng2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oebdXvTF; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jf2-20020a170903268200b001869ef16477si5141847plb.356.2022.10.24.09.11.24; Mon, 24 Oct 2022 09:11:39 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=oebdXvTF; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232809AbiJXQKc (ORCPT + 99 others); Mon, 24 Oct 2022 12:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbiJXQDZ (ORCPT ); Mon, 24 Oct 2022 12:03:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32D0E1162FB; Mon, 24 Oct 2022 07:56:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 37B26B81693; Mon, 24 Oct 2022 12:27:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A920C433D6; Mon, 24 Oct 2022 12:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614436; bh=bt/7eh6FfydEePQtgDsOro6ZK50zNzKZYCGlPt6CeTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oebdXvTFmQ1I/YVTHTBrPlxI/zp9BGyVx9+ZcaSjew27c4TZ6/JZR5VixNTdJ6pod TlL0/yt1d3qDL1HSoYPJxSuTaieCUXjYERlviCrqswtzeG/ttnM1JKjsxhiH7kgZU0 LOBkiyR47OjoRgFWchEdQofU4fUcCFfWOSCcRHvw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Tony Lindgren , Stephen Boyd , Sasha Levin Subject: [PATCH 5.10 261/390] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Mon, 24 Oct 2022 13:30:58 +0200 Message-Id: <20221024113034.002988427@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747586015777770175?= X-GMAIL-MSGID: =?utf-8?q?1747586015777770175?= From: Miaoqian Lin [ Upstream commit 9c59a01caba26ec06fefd6ca1f22d5fd1de57d63 ] pm_runtime_get_sync() will increment pm usage counter. Forgetting to putting operation will result in reference leak. Add missing pm_runtime_put_sync in some error paths. Fixes: 9ac33b0ce81f ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220602030838.52057-1-linmq006@gmail.com Reviewed-by: Tony Lindgren Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/ti/clk-dra7-atl.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/clk/ti/clk-dra7-atl.c b/drivers/clk/ti/clk-dra7-atl.c index 8d4c08b034bd..e2e59d78c173 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -251,14 +251,16 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev) if (rc) { pr_err("%s: failed to lookup atl clock %d\n", __func__, i); - return -EINVAL; + ret = -EINVAL; + goto pm_put; } clk = of_clk_get_from_provider(&clkspec); if (IS_ERR(clk)) { pr_err("%s: failed to get atl clock %d from provider\n", __func__, i); - return PTR_ERR(clk); + ret = PTR_ERR(clk); + goto pm_put; } cdesc = to_atl_desc(__clk_get_hw(clk)); @@ -291,8 +293,9 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev) if (cdesc->enabled) atl_clk_enable(__clk_get_hw(clk)); } - pm_runtime_put_sync(cinfo->dev); +pm_put: + pm_runtime_put_sync(cinfo->dev); return ret; }