From patchwork Wed Oct 19 08:31:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4814 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp221697wrs; Wed, 19 Oct 2022 02:32:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6uKD5Qo5flc9P+aExsvGiBDqDUzVSFpnKQde4Dx73Z6oZ0DDhUPqtGXBm4/n9w/VXE7GqS X-Received: by 2002:a05:6a00:1306:b0:555:6d3f:11ed with SMTP id j6-20020a056a00130600b005556d3f11edmr7689230pfu.55.1666171934527; Wed, 19 Oct 2022 02:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666171934; cv=none; d=google.com; s=arc-20160816; b=czXDCTJa4E7qeLnCl99bfWWzoHCx1Ms7xA1Uta/XwDkXLNpuExe84IyNI/Emli/Oc1 71cSyB9PUMXw5JYpIgqEIkiJ5Ze67seGoIdZA5TSbkYDIbuA2UAmi9DDiAmhBrDaPNPG IffRKN0o5fmCWSS1xLwN69rETC/VIYh5yypKC8rOlcItwkBFWCtc/HIaX3P5iFIiRBtS 6WV7tD59BoPfVv8k0DyliKIdWPr+hcIuRd+Ro6ycTXiBI+BxV2dBQnXfSy/Q7Ip4nwPE X+VKIJA2LjuiohCXKtRoV7uqanDtIX7EW5hXjVSyP53Jga/tDeWLZlI65HICo+CTY3cQ Xolw== 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=NWm5zSh7HVXxZm+p7LQatkw+K0AC2OqVZ/eXnpCEpDI=; b=DiwG2tZkiz1fOEOHbn3Qi3p3cVKTVylF2FjvClSkVjCUPaSuJiwHZT+eHNkxG3LRcV fQyO5qSIgHLBa3hO3kc5Xb1h9weMcgaAHPPiE1QcCmKHT8dHdYulFIQiwFWyQVt67dNV el2Rdkj3d1/xGgwKDA2oEt9gUodilJ5sArTkipK5vjH8DFlaUNSqhD718/SSYNoPGiiw 8OVmq+CstMCflpE+l2MxqhONlKEupntHhhu1jjHAYXRCvlo+/iKHbyznr/pQ/6kPknJv R1I+KO4EdzmNGPxGnfejb7QxNBHX5mGfGBGMhzESL00ecVBL6XRVnKMoq6NV+97iSkiU gNTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0mLk2CPD; 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 cm9-20020a056a00338900b0056771c032f4si1882568pfb.28.2022.10.19.02.31.58; Wed, 19 Oct 2022 02:32:14 -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=0mLk2CPD; 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 S233289AbiJSJSH (ORCPT + 99 others); Wed, 19 Oct 2022 05:18:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233665AbiJSJPg (ORCPT ); Wed, 19 Oct 2022 05:15:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7856B1C7; Wed, 19 Oct 2022 02:06:16 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C739C61851; Wed, 19 Oct 2022 09:05:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9BDEC433C1; Wed, 19 Oct 2022 09:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170338; bh=3X88PMqkuFvbCL2Lx1FKmQEB2o2cLmNKVi0b2sFtjAk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0mLk2CPD40mjPK4qpr8ICu+0FlSn6/tvQtRA1RUHwQmFL8nC9LWmz3+CCOFra1IuT XnYKw0tMMGET/s2Q3VkqmeWsg+aj7DyFgdUFNDzRWAlf3lYEgI2FppGzhfKcC5p7zq Oh9C6ewKWuyfKioqBK+I/8kw+OBaZQudQn2E/Vd8= 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 6.0 600/862] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Wed, 19 Oct 2022 10:31:27 +0200 Message-Id: <20221019083316.457225483@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747107902168003187?= X-GMAIL-MSGID: =?utf-8?q?1747107902168003187?= 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 f0f5bf68b6d2..ff4d6a951681 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -245,14 +245,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)); @@ -285,8 +287,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; }