From patchwork Mon Oct 24 11:31:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10232 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp643029wru; Mon, 24 Oct 2022 13:40:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6DVGAwzw66vtlhRwd06ic2kGEu8lqjvdigY0DS1Ek+02FD/lG0808bTWSDId4HLArJlEbP X-Received: by 2002:a17:902:e9ca:b0:186:8624:9675 with SMTP id 10-20020a170902e9ca00b0018686249675mr16494267plk.76.1666644016440; Mon, 24 Oct 2022 13:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666644016; cv=none; d=google.com; s=arc-20160816; b=O4mwEmrwvltv2AUT/qvJrJuKUY27PmSWfsvhDoL4BdStpFeh8q11/3Pp3Mj1jsKywY UQprQXg5MMuM/nU/6ug1eN02yUqalMyT/6WbvcpIqRkbXSVyvMgYDz2RCFkkIvXHrUG+ +GjPjWIURfiar3cu6/aeDU8DyRSESR46dwwgqdNnJf5oD6Fv1a/1u3Q4RzSHA+YKGfaY gpsxOP+LYhS7aPZMHsCCDzq5cyC0UT8nERVr4+zjbvjGdqVv4Dx+wU8k1nPIfr1LLECv EQFB7YSsbkI6SY6coUpMceP/jg0GCYuQhQVO5ZjWFi/uCNelkOX5RY9SxdgW2VDnK9aL ZywQ== 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=OOlbhsbp+/EqP16Q2Ki5GceeM+xRRKaaU6goS7nuYY8=; b=UYRb7kMawyU2x8YA8rHmkoYsTmGDHCc3zF/XjC3/bZDGjHQ/n6FoDlpMeqkoTw6RmA mIdS1kYGnuVsvMGtkFxCu9fqR1HS0gUmTWBD2refIsYeQU9T4L2lBV0BTb3KVhpcKggp u9dOWx+b78/JrFzvYx3AH35rpsN3kJW6vnxvgOq4vwrKyFRxswIkcrBlEwv6ELuG3VLy jPgQyi4VOqhCNrrrRD9qlDDIFS3OS2g+yofOgsspN0tWbW5DA9mPKcmTlZyh76piWyw1 oLQeMO6on4FB/GgyOb4FIcIYJp21iqV6Y0XFd28pw8Cx9fqbXEt++YzqYUYrvoPB48m9 eang== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Qpo41qI5; 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 na18-20020a17090b4c1200b002130053cad7si6932497pjb.7.2022.10.24.13.40.01; Mon, 24 Oct 2022 13:40:16 -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=Qpo41qI5; 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 S234550AbiJXUje (ORCPT + 99 others); Mon, 24 Oct 2022 16:39:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234627AbiJXUib (ORCPT ); Mon, 24 Oct 2022 16:38:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E93C7CB41; Mon, 24 Oct 2022 11:49:36 -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 33307B815CC; Mon, 24 Oct 2022 12:11:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F5ACC433C1; Mon, 24 Oct 2022 12:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613515; bh=Qaxm+KpYiwp6r+MQOOQTgNCb+e8i+Jhd85FQVsMX9j8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qpo41qI5cKAS/uMk/Vj4W61c528jGe5gyN3+kcBH6VE7luke398yRt91/gczcqrQj GIPUwoqaSE3XwhzCpjGD9RjVfgE210t6oWNxOgNzpkOX2XV+8j0s+s11QQ6kKvLK8f CLhXlqpJXuk9lGLIAXoAeuJg5s4pVoqC4+muRiww= 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.4 167/255] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Mon, 24 Oct 2022 13:31:17 +0200 Message-Id: <20221024113008.294491304@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747602916262679268?= X-GMAIL-MSGID: =?utf-8?q?1747602916262679268?= 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 f65e16c4f3c4..62ea790d79f9 100644 --- a/drivers/clk/ti/clk-dra7-atl.c +++ b/drivers/clk/ti/clk-dra7-atl.c @@ -252,14 +252,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)); @@ -292,8 +294,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; }