From patchwork Mon Oct 24 11:30:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10285 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp653718wru; Mon, 24 Oct 2022 14:10:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6V2whKbitRVC7PhgdYPQSToAHYSN1fJHXxp3+1tQjMjauua4GDkdK6suaDEpL/4btN3MKs X-Received: by 2002:aa7:864a:0:b0:53f:dcdf:4614 with SMTP id a10-20020aa7864a000000b0053fdcdf4614mr35781948pfo.38.1666645840140; Mon, 24 Oct 2022 14:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645840; cv=none; d=google.com; s=arc-20160816; b=ETIIdOZEKGByS4rlpecsBkJ8x6UPEcKTquNQcdfU8WASnyUXJwiyWEZ9VFeT37CB/G Wljy1bFxkPzGbqxk+Z3euJiCtl5JJqG8hn0BSadSiToErnIfHDxClFbLw/hl1MkvWs3V JPplVUFNzL1BaYjRGFdwZTW2PYTU8YQMqw4c34fdpH+FYx0YmqCGTSI1KmEA+ux1qICR h0lVTWarexkYvfZbchCOZ90/bhaHhIzV9dCI0tBDM/L64D3Gk2SDvg/FkG/8oVMNPkSZ egCq2nSwtVzLhIz8K/eAIYtVsHDbYLAdM4BpnELfZ8CqcwecxEr00xaFg/MqQJ6weDUy 0ZVA== 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=ANtJE1VSNF7gSaxBl5fyv7LHdfs3Zw14u9lLMnqOeXU=; b=A7uCVBKXvRptUJH30GBGbAVOZKbbN+xLLJ6QtDUuOGl6LTPie4xNdDB9id60Q4pFFZ v/lu+KVZJ3MmJGyJEmSz1wYPMuqPMywIkKAHrsuMw1e+zi5COpZWDWElGMKuN/x2bCzw W+xeEpWsXXG4lDnXXIf1Gi9Kv+k4VYw9SuxjiJe9tmNAEko6gQphlZ8CLnF7CWOe2bw7 TGQpuDyqmRgnsNgVJomjva6sWh/xAiWmLPpBKXxZa7LnHlRG3aGmO9m2aU/CoREiFUOw OOrkHU0d2rJzyFuqG/c2AvRFuxOb7BJbU53bJEzDkbS8sx7bnifbfHVawtf06NW6TnCC bQIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=AV8cy3V1; 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 y20-20020a170902ed5400b001729146e418si493551plb.388.2022.10.24.14.10.26; Mon, 24 Oct 2022 14:10:40 -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=AV8cy3V1; 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 S235124AbiJXUyx (ORCPT + 99 others); Mon, 24 Oct 2022 16:54:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235272AbiJXUxw (ORCPT ); Mon, 24 Oct 2022 16:53:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6D8E168E56; Mon, 24 Oct 2022 12:00:31 -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 C8BD4612C5; Mon, 24 Oct 2022 12:01:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9F5EC433C1; Mon, 24 Oct 2022 12:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612883; bh=8ggShBhGOJwKpgRbOmOgbcjHdyJf4iISNtbQntcg8Nk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AV8cy3V1Hs9cGE1JEJGidht2aydcztQ4VlriWhXA0Cf86PFJlUJ+JRqyyYvL+cYCs WrJE4KA/ewg88X3KSan6jdIxhTB5QJuCsWeH72mPb4ZkxJFR9KsPUsXPqELjf4vhnz fMJ30HMmjQXlW0Hxsl5epxiBKAwM9yOJYi8geLKE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Stephen Boyd , Sasha Levin Subject: [PATCH 4.19 124/229] clk: tegra: Fix refcount leak in tegra114_clock_init Date: Mon, 24 Oct 2022 13:30:43 +0200 Message-Id: <20221024113003.018607937@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?1747604828226001874?= X-GMAIL-MSGID: =?utf-8?q?1747604828226001874?= From: Miaoqian Lin [ Upstream commit db16a80c76ea395766913082b1e3f939dde29b2c ] of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: 2cb5efefd6f7 ("clk: tegra: Implement clocks for Tegra114") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523143834.7587-1-linmq006@gmail.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra114.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c index 625d11091330..1e5025c127bd 100644 --- a/drivers/clk/tegra/clk-tegra114.c +++ b/drivers/clk/tegra/clk-tegra114.c @@ -1348,6 +1348,7 @@ static void __init tegra114_clock_init(struct device_node *np) } pmc_base = of_iomap(node, 0); + of_node_put(node); if (!pmc_base) { pr_err("Can't map pmc registers\n"); WARN_ON(1);