Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7181161rwi; Mon, 24 Oct 2022 10:51:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68P7xV8eYNCn0Rjp0r82NOsv4ZujzO5p2fIrRMuMq4DiV8r0jsoj5K+6+nZ5E6oi4J2PS0 X-Received: by 2002:a05:6a00:22cc:b0:56b:f793:5ab2 with SMTP id f12-20020a056a0022cc00b0056bf7935ab2mr3272627pfj.3.1666633870626; Mon, 24 Oct 2022 10:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666633870; cv=none; d=google.com; s=arc-20160816; b=EABY9lNaRsOjesp3OqjCtHxD4iDZ7BMaszlA59aNDKzwDDvPcKihoK11VtUH5cFzqa CnQitSHNlgRZ1Fn4VFFWg2ql48Dpo+evwqcOcZUL2Od8AsB8aFb38VXvRrg22X09wNNv HSdis4qCjYRq0sjcAqToBZMnKyP+g/Xa9/64em35Yrv6AH72Ivjf3tTo6M/AYcgtLSbJ mk2pN+LsQ2V8iHwqNdBeY1wjNwdKrr2Fo9LQNGjlyadOo+sse7qq31taxHhTXvncsxDk oF/09GOHUhdmXzyKko4Rb032dCqHNTPNXLZEH9gGeh6bssYgVTVH3xaUFav7JuIa9vRH 4QZA== 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=2NsVfEzlhvEzi5aHh+iOiinL2WVjERVE94ktO/Gz9TQ=; b=KpXWuYXSVAq7HFWSLENEHbQU8WBk2QNXn/lN0Wkl1mPwTzuxx3+cBuwM5Ucv2kEbGR j+M0vdHdUjDK7W2gZidjdbncADne2QEU4BIR0vkeT30/7t9r3Xhcne2cDDNS/244rB7x BXXzuJGyuFw9WL8ii43Y81UKhtEhLIuk1ht94oloNmn/Ek9ZLIxZq1OhXv0W8w43AN2p d610yDc4nFZhzD/EuoGPxNaL4924fA2Zl/Wf3F5mg0rqd5RdtXmFXs5Bzfyn+9TH9hez 8RSzELDmba0c3wxRcngApv090uN4wEG4Fpk/EP9CRlCrEvaFrkBRAkGAMd8uiH4EC3lK RYkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jnbsbeeW; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s76-20020a63774f000000b00434ac3b9915si69067pgc.790.2022.10.24.10.50.58; Mon, 24 Oct 2022 10:51:10 -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=jnbsbeeW; 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 S233038AbiJXRBK (ORCPT + 99 others); Mon, 24 Oct 2022 13:01:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235108AbiJXQ76 (ORCPT ); Mon, 24 Oct 2022 12:59:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D0BD27CF2; Mon, 24 Oct 2022 08:37:42 -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 DA212B8120F; Mon, 24 Oct 2022 12:01:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 370F3C433C1; Mon, 24 Oct 2022 12:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612880; bh=cDvYVHixIoAOQLcS7OGG4/vpzoLWK1qd2faZwAFtgv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jnbsbeeWODvJ4BpxzPUDluBUnm71LTbDkncohmD2HmJynDBrAbMvUVHeRFLgBKdKq 8MT/YExm/hS3OXj2KHUwkWW4J4ZXXQGhXAZi6AGUzigmQ9eaxD8qtO7dvm585I12T3 13JyLTn895JgAPntexl+3pshgZOgxjSTdGnbnqXc= 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 123/229] clk: tegra: Fix refcount leak in tegra210_clock_init Date: Mon, 24 Oct 2022 13:30:42 +0200 Message-Id: <20221024113002.982592246@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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 From: Miaoqian Lin [ Upstream commit 56c78cb1f00a9dde8cd762131ce8f4c5eb046fbb ] 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: 6b301a059eb2 ("clk: tegra: Add support for Tegra210 clocks") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523142608.65074-1-linmq006@gmail.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra210.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index 7264e9731034..f97c4b0a9164 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3529,6 +3529,7 @@ static void __init tegra210_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); -- 2.35.1