From patchwork Mon Oct 24 11:31:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp433449wru; Mon, 24 Oct 2022 05:49:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/fozw9n5QLFv99Hfv55ZgTCGNIh/+kma5TGSfGxy2I/FkUQecp+thgkWaKaZ+Y6z8ayFr X-Received: by 2002:a17:907:7fa5:b0:791:9a5f:101a with SMTP id qk37-20020a1709077fa500b007919a5f101amr27333359ejc.453.1666615772829; Mon, 24 Oct 2022 05:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615772; cv=none; d=google.com; s=arc-20160816; b=QSaeSCdDYT5w4UR7TA+4o0M8otjSFvnMD4wBzidO8kHXqHszmEMRinUFVkAvYeHzfz VoKBKzGUdp+SB7wohNNk/gUNpdTIaS3Ceq1aw+2iEcgOY8XLM2wJ1M4M6WnubkJqV2tk AHoTuAJaPel6a3dsCyy54o6YkVDLCM0yeZ4JfoGragZKUCjYZsdt4Gip5gXUc3ousUTn H6prIVy9IEEUk/BuI5yxW/yx1IdTpDKrWdx9YsETUytZMGDl8G2zbEQ6X3ts9tLSpEX/ AKZW1d5KMNk1SNVwIuTO9sJFyLrRZupfYydpneWEWvR7anWLqSEEGkckEcXIQKjuKuB3 e3tw== 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=zxz2aFx3qD3JbKa/GPaw/tyif26U2V5X9sHZVfTfK/Q=; b=DtY4bjqQ1wiLPfNx4IW7PDap7TvxW5294aOJAyDRSyYN5cuwAwVJ+LKmKOMYe0i3CB 9lJh/rW/MY/mkgBi+x7a26XMocedePyEiVYZtLnoJHisW/6Pzmnx4qHReR5gK9zDJSqB YurNkTaB1W3IUMoc8+TjlNJxx27qxg3peAzB6XNsL7MGM3TUR8qYSI03KQ+oWFGSbniq ENooycBKxDeL23n/X0DZyE/KYKccDtR5zBxlaSggYRhRT2QKHpXcm2eeN1pIRWhQhaDN xicQ4rdofGeh8DLczRnrUhfcz71A6z+nkSkd98zcsfA62wXDLNbHLO7eDNS2x3mjk1lM dxUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gSF+UaIh; 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 i10-20020a1709064fca00b0078db1258ae9si32697627ejw.555.2022.10.24.05.49.08; Mon, 24 Oct 2022 05:49:32 -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=gSF+UaIh; 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 S231738AbiJXMiF (ORCPT + 99 others); Mon, 24 Oct 2022 08:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233904AbiJXMdp (ORCPT ); Mon, 24 Oct 2022 08:33:45 -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 7E262476FD; Mon, 24 Oct 2022 05:05:00 -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 03310B811F5; Mon, 24 Oct 2022 12:02:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58533C433C1; Mon, 24 Oct 2022 12:02:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612969; bh=rJmvJX1Yd+VCFEKraff9jIv/6wTZs/svtd+hRJMqLjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gSF+UaIhCJ4S1+Q66DjdfdWYwK6EU6zTAX+PT9KrKeVuqeRpY2oQmkwJ6M0OtNqKg uewdZISQ032FND2t8qmGCvlVZX8L2BgCQoO/Y/se8S0K1tF460UI8AXA1Ri6LS4Rnt hP7CM5wyMuwxgtea/1f4dPv8Wr/x7Qgbj5owhhxQ= 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 4.19 157/229] clk: ti: dra7-atl: Fix reference leak in of_dra7_atl_clk_probe Date: Mon, 24 Oct 2022 13:31:16 +0200 Message-Id: <20221024113004.085012351@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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?1747573300742175916?= X-GMAIL-MSGID: =?utf-8?q?1747573300742175916?= 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 beb672a215b6..a4b6f3ac2d34 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; }