From patchwork Mon Oct 24 11:30:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9369 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp476447wru; Mon, 24 Oct 2022 07:13:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5VsUIklBnD2PZje/+tYzD40fvVS/93wssMdv9MpnQ187lSOx6LDxKQURug5W7/0eM5WJ/+ X-Received: by 2002:a17:906:5a5f:b0:79f:9f1f:2fef with SMTP id my31-20020a1709065a5f00b0079f9f1f2fefmr12061555ejc.396.1666620838118; Mon, 24 Oct 2022 07:13:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620838; cv=none; d=google.com; s=arc-20160816; b=DK9o+vtAtycNPXQj4FpiDv9gA93d+yfmnIRXdP+7iRBFHcymbgVLYSoeKD+2Y9f/ia TUtO6Zt1DWqmyuTAHjXrQg4U21vrmAjV2lFU1GauzciJ3fCUkHENgSOm8cMqUijiOsEm HKiOnSA0JdMEEcYiTXWEkPfnDGT1mg7nZ/Wd/E8gSVi/Gvwh/2/zn8L4Ziq4XA+cvA53 4STKvv+XEbhDFUNlDwH75vz8pkv9JtQI9HBSVQWp/WWf9vtyciwHyA7nQudsGAOIgSgP 64PWIDF7y4HJ8n/fClU3d9/TWKm3zV92VxVEnNZk/cp2wCH/7hsOoSDom+I87XgQWKLO 7F6A== 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=eAAKgLZEXbgdT6koQ/KxJdWDEo+s+siAg+xDlTBATCw=; b=sC4yqTGrCusxmeKyyUqBjWIzmecwodaMJZiojr4vyQke3VpBnaHosDooD9cWzO2LXs 5P20kE7F5lnKCbNxEkMnd+8ffXodG87rlH/p0d4VBJbF67admwM1HGzn2e2EbmRW6crJ TmIGSHwAPZebY+ucdWinPfUkOCA9N1bI+Opw9r2K5dXVGR2erh8F05u/UKN4SUxeUKGR KiN37KItfnJ1MVkoZP5O9eafk8MQzVU/P4IshqGXUmfyqpS6SQm/VYTmf514UC9yU7t7 NiN+nIz7H2TjBnmQkwcWwvoqz62uD0ecxcySQ1VlUJzItyLRPhX2eCE1gmymAw/3guAZ VyLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=udpv808U; 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 hq10-20020a1709073f0a00b0078a9cbab78asi30586505ejc.738.2022.10.24.07.13.34; Mon, 24 Oct 2022 07:13:58 -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=udpv808U; 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 S233076AbiJXN6s (ORCPT + 99 others); Mon, 24 Oct 2022 09:58:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236865AbiJXN6U (ORCPT ); Mon, 24 Oct 2022 09:58:20 -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 EF376BCBAC; Mon, 24 Oct 2022 05:45:50 -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 8784D61335; Mon, 24 Oct 2022 12:45:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B73EC433D6; Mon, 24 Oct 2022 12:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615518; bh=kMGCH9edRl2ZiDhNMoRbgxB9vhUgFy45G/W3ZpSSlYQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=udpv808UetJEueW1wpzrMoT9TpLAe7DXf9PkC4aNkcdd57LPLxRegzO1ZFc15sBIb 9Vz4fXiyERj2E9jflA9FCuQMon/lvuy58nGu16HUfIHzoYeKRYDyX6CjWfAJTOWnRa WzvopMGnC0OjRqaMitsygg3hagqQ9jYM5Nj3rHBA= 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 281/530] clk: tegra20: Fix refcount leak in tegra20_clock_init Date: Mon, 24 Oct 2022 13:30:25 +0200 Message-Id: <20221024113057.787774182@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?1747578612041191145?= X-GMAIL-MSGID: =?utf-8?q?1747578612041191145?= 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 3664593a5ba4..d246a39a6b4f 100644 --- a/drivers/clk/tegra/clk-tegra20.c +++ b/drivers/clk/tegra/clk-tegra20.c @@ -1128,6 +1128,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();