From patchwork Sat Oct 22 07:24:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7788 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1122680wrr; Sat, 22 Oct 2022 02:31:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7YIA9wAxiCL03XRIyXC255rXY8iatP1fCrBt4sFISMGeQqjMsXvog+PEervZheBbCgS2Ou X-Received: by 2002:a17:906:9c82:b0:781:5752:4f2b with SMTP id fj2-20020a1709069c8200b0078157524f2bmr18661260ejc.561.1666431097936; Sat, 22 Oct 2022 02:31:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666431097; cv=none; d=google.com; s=arc-20160816; b=YLJhXSmW93UPO5kpwprPaSGkoUnzoi03LLWA7xzJPsDi2V9dVlM4TYkIz5WOdsy9Sn Q+Rt5ed+B4ddZNsZ3pGC5ouJxqvx65eZ68FaDdYV9A7DxXQH8fo2wMA0lz6bGPHEB8Vv 42jIMu+Pe/eNJqI8sEA/4wGgqxwFOsyZPIwChG/wLFbZl2V3Jbmmjks5aDrD4YT+49AV xucFXXqjr9LbXXfI/6AaDfkFKIMr7048CQOe72j71I0JUDNI9/Q9HyTX82MxzkrqcFlp DSKJOVcGjoEbTtlRTtEAwSXDVKzVDdrQT1TRtoToCHTTZ07N97eFMSvUQX+Osmo5dOCy SJeA== 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=TCifrgbVIhF6IG3IN/+rWiGab9iYhQuo/bM3ZkfqbCs=; b=cen2YGSRvdqUxH1C6nfMuzsrMFf7Ex2Ai+kBXELnE9bb0bJRbh1qjcizvQxroyzDWZ IaaXWYJ8L6+gAgz0crS8npW8ay9vFzbgkxmRsqA/DAsb4OB9hHG1HuB+uaVBqLDBwou/ UVM7bgKOhLLtWCzrZdXoCkRPmORkd75DfZMy5568XlICBjTTfvK6VD3ipwMlmT47cUAN wp3qWURWosTLjrRsQ8ZRVo/Urvg1t7gfmCN4WyoeVCh0Rnjtvk5RgHwx1aB8rFNhNNQz AdbxBfNguBuhQu5ZaPatV+XAcsiJTQ+sjswcPaJs9pytAkfTuRBoEzojXgooMXgnA6Co zobw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KinvGyGv; 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 cn25-20020a0564020cb900b0045d53f8ea52si17698881edb.1.2022.10.22.02.31.13; Sat, 22 Oct 2022 02:31:37 -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=KinvGyGv; 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 S231245AbiJVJPi (ORCPT + 99 others); Sat, 22 Oct 2022 05:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230474AbiJVJO5 (ORCPT ); Sat, 22 Oct 2022 05:14:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A242C64A; Sat, 22 Oct 2022 01:29:40 -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 9011F60B79; Sat, 22 Oct 2022 07:51:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94311C433C1; Sat, 22 Oct 2022 07:51:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425103; bh=jY5QCfw7xTXd3ZKXFT3BA0Dy8YBjTPowLa9k7IVWMjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KinvGyGv8pYOg0vqWQ0fcQg1+z7y5LRzRqHbSqyhFfOKB70j23hrStZkPTTsRzf7s xWd3ItHETRRWs0jhoopDyJHWVxSqj2jtP8ykp2KuIwA8slBXz8yy1urqwbKrnm89Vu gyWIGdCSeNOqv98ccix1Toxht9ewdFq0AO1a//qg= 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 5.19 389/717] clk: tegra20: Fix refcount leak in tegra20_clock_init Date: Sat, 22 Oct 2022 09:24:28 +0200 Message-Id: <20221022072514.805820361@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747379655174922277?= X-GMAIL-MSGID: =?utf-8?q?1747379655174922277?= From: Miaoqian Lin [ Upstream commit 4e343bafe03ff68a62f48f8235cf98f2c685468b ] 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: 37c26a906527 ("clk: tegra: add clock support for Tegra20") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523152811.19692-1-linmq006@gmail.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra20.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c index be3c33441cfc..8a4514f6d503 100644 --- a/drivers/clk/tegra/clk-tegra20.c +++ b/drivers/clk/tegra/clk-tegra20.c @@ -1131,6 +1131,7 @@ static void __init tegra20_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"); BUG();