From patchwork Mon Oct 24 11:30:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp427262wru; Mon, 24 Oct 2022 05:33:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7AN/uqZiJd+yna83A5h8EJIjEqJPI2xH5dyOQiDIzWfugZhrurwoIDfxRzs8uv96dK6Eml X-Received: by 2002:a17:907:75d4:b0:78d:efa7:f78c with SMTP id jl20-20020a17090775d400b0078defa7f78cmr26752016ejc.454.1666614783702; Mon, 24 Oct 2022 05:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614783; cv=none; d=google.com; s=arc-20160816; b=ARU+paGQcdw1WX3IpQqXefjTmfJQX0aZe97vYduOyyvCpEbfE8Y+AytJAUGQk2d4Wo bX5cG7/N/W5EjifFAehvDhpEw5u/NItXFcAZuKm0wTPIb3SRbck7vhkoj68mN5CnSnVt RXTo/6TQEq9NhLlBIW8on9wtSkVbf5GEtVFaLLtH0CYUgYNdwrjjt5AbZxbDgSblBLqY 8V1pjcJZk2FG6WH5O4KzsG7hrppgDPkWPEe6PZdVpK8dTgVuYfyNYMjs4r7wBEntoG21 DhN5Yb+0mL0aycH5r2g34E+yrGiuGqMppKMkRvXcW1kDXmigaNcPld2RaIPdZNTovqpI cUAQ== 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=7SqHZqaQTGbk/IExNnP6L9Jt+PYKLLDOuqhkchbUpWU=; b=LXz4pbeZR6tED5B5ZdVrA7+ps9A85u/rxOFYaNoDSXWwTLmcyjiKvwBNR8eKP/zSE2 awnD4Ab/mv1mk4YXVi2i3L2TxvNy+SaC4yVQeSvASSJqjR0iRCkesjbDBP6QAB+L2hWH 2/VtMO/TiQ9KDsvrStM6Ow/D3in1zvPlaHmNrKrgt9t3cuV1O62CByK6fdlHeySk0q2Q os2fr0Zqa5IWla1QdkzRSp5c8S3DRgrboirtfWXAoeaCF4VSPOzRNgyR0G3f23/kmQe5 9Mt/55FhFXPEBj8BA0uOr7CGyCI3m9DkqqBRqVZtKt57OdYhzbydzFU1w0mYusQtOigq eBLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CDZlYq0b; 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 gs41-20020a1709072d2900b0078de536a3cdsi28707371ejc.119.2022.10.24.05.32.32; Mon, 24 Oct 2022 05:33:03 -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=CDZlYq0b; 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 S233702AbiJXM0P (ORCPT + 99 others); Mon, 24 Oct 2022 08:26:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233903AbiJXMYg (ORCPT ); Mon, 24 Oct 2022 08:24:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF9516417; Mon, 24 Oct 2022 05:00:28 -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 8E604B81188; Mon, 24 Oct 2022 11:42:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DDEBFC433D7; Mon, 24 Oct 2022 11:42:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611739; bh=DSWPBaupk1FspFM1N7wF80naJQX9dlmXeX1iHdvRU/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDZlYq0b7Iti1WqO9nH88wQesb155L2hw3cH6zPgtghQkfRErLME1tbYo6WtYwHVk ylB8Cx9fHUhE4tsE7dHptpyuhFVDwHVP1ItKGBifqCDSzRVGk9+XwKnXr+FZ7gkjjY Mc+oqAw3gfaoyJG5vvnUDiWV6fhXTp8f0IdACtuY= 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.9 093/159] clk: tegra: Fix refcount leak in tegra114_clock_init Date: Mon, 24 Oct 2022 13:30:47 +0200 Message-Id: <20221024112952.824833021@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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?1747572263531934856?= X-GMAIL-MSGID: =?utf-8?q?1747572263531934856?= 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 933b5dd698b8..c92d8f36a00a 100644 --- a/drivers/clk/tegra/clk-tegra114.c +++ b/drivers/clk/tegra/clk-tegra114.c @@ -1342,6 +1342,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);