From patchwork Mon Oct 24 11:30:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp476247wru; Mon, 24 Oct 2022 07:13:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5quv+ESFiditzYbTnB5hSGhrO1SMSOkmlaW1Oi2rFI47XxjEvhpQAbKPdibDdX4dbCgZiZ X-Received: by 2002:a05:6402:3c5:b0:45b:55d8:21ff with SMTP id t5-20020a05640203c500b0045b55d821ffmr31229609edw.253.1666620813410; Mon, 24 Oct 2022 07:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620813; cv=none; d=google.com; s=arc-20160816; b=JNkrHxQHQB//UeZ94KCXY7UOG59euQcEOgWH2RZDPqyyKLJ1XZ+0xThuKxP0WtUaXz XU7j3ZbaxpxEuhddS5+umVYdp5pTt105grF+sUDuaN9V61IXEZvRJOPbVfLIot8MI6Ll zOi0Qu3K+lPDrA9KysTHyYZPuUG1q1HtE3qmuEHhwvoZa7ilXkvhrNDvX6eK54I1OAAE 1h+/02V/MCBbe9M2KtKA+CFZXk70I1k1ihhoKYmhNaThCdcgmXJ3mhZ4kJ/HIo7+6D39 W/YmoBQyXQjak2NsQG6PISe+qTSVQDdayAJjExP1GWUnmTe+ANZUpe1Abr5qaG5Pa2ri UMFw== 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=osn3Sd73uGpMJqv8P4LvWhZI9l3c41gqPT3e1Sbrpx8=; b=u3aQGV8iNMazGWx2AfavVc+UUQV6xTf8K8tY8MStDIKZ5MJ8psdNIrEmmxRTWuGTkd 3GMZx8lXlJfJx4PIBl5bKC8x/bVfX2nsh8RvyR1uwsrba69IC1jIqxwQdUXnf72fGWOy jDU6MrG8p80GhkQYpU0DN4D/0ylhJ2eoZss9zlgrGgl+eKDYP0Rru8WmjaZDCBl1dgp8 MsTsn0Z3o31fZcE2mvdfhjmslvAgKp9gaS3T3WSAwu8olWcu1khYhQdYmqQoLAMmWmmF 2kRfSdSX6xhdNMFV4yqpQCp+QsBU1IcaNT1504mN+cuv59q99VJY0hgGNiMpeFYL1rO3 QxbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=p3zyAyw3; 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 bx26-20020a170906a1da00b0078d45e9d485si23042901ejb.709.2022.10.24.07.13.09; Mon, 24 Oct 2022 07:13:33 -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=p3zyAyw3; 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 S236842AbiJXN6o (ORCPT + 99 others); Mon, 24 Oct 2022 09:58:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236814AbiJXN57 (ORCPT ); Mon, 24 Oct 2022 09:57:59 -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 354E02250F; Mon, 24 Oct 2022 05:45:35 -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 06E3F61325; Mon, 24 Oct 2022 12:45:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7D0FC433D7; Mon, 24 Oct 2022 12:45:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615515; bh=MYOwrjZCrWWsWxaSojRO2Wg1Ovu0P0g0HHH/slM/tnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3zyAyw36+Ki6ptu0KceVRBaxV6r5lp286ULLPdvcXmMlpjky5Kh02zCen1JPGBLu tQLK1LKz1d512dvK8ijafuSmGWynqk4lbFfB6BmHFqLzyGy0et+LCPmltKh9PlFdak mq0Yn/FCpTS58OWQPj7dfCpwl2sgpFVyxzu1Mrpk= 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.15 280/530] clk: tegra: Fix refcount leak in tegra114_clock_init Date: Mon, 24 Oct 2022 13:30:24 +0200 Message-Id: <20221024113057.746771802@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@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?1747578586126039512?= X-GMAIL-MSGID: =?utf-8?q?1747578586126039512?= 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 bc9e47a4cb60..4e2b26e3e573 100644 --- a/drivers/clk/tegra/clk-tegra114.c +++ b/drivers/clk/tegra/clk-tegra114.c @@ -1317,6 +1317,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);