From patchwork Mon Oct 24 11:30:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9853 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp559084wru; Mon, 24 Oct 2022 10:05:51 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42lEiHx9iJp0gHd+A3/MMz0cd0ISnQIt2+RX9E6a4HeR0QHYOoaPQ/BZUmdGt9g5xzpS8g X-Received: by 2002:a17:902:ab5d:b0:186:bb2e:85a4 with SMTP id ij29-20020a170902ab5d00b00186bb2e85a4mr1491100plb.135.1666631151616; Mon, 24 Oct 2022 10:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666631151; cv=none; d=google.com; s=arc-20160816; b=U8YjQHI+r4fRdFurng6ZfaqQ5cI/Yo24JtjVuEmF2iItKvNdEOva9t7/40C4fajREM A76LJSMg3AabgYuLUfaoP8PgU1Zx+dvDpdAJG23pgD9oNfbreLo1k9UzJlucPQcfYL6E v46ATdqdx3gqHHI1qyGyxyl7IwssEJ+yGqQ06NBCx3BXG1C8hnerTs5tRG+oFWPxGEs2 7okNMDj+wvSwk4hJWgSU9/XHXE2H62zM9XUAd5oad/VlBDiQmaHnGDCOdYlavEsvvwzU E5Y/IHzlKNn8dpa3CmeHXFAzyvxTh0+uSUyPCd3UyuQTIwg2o0YvNJfi6TYkbwnti1uI LE9Q== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pm9-20020a17090b3c4900b00213353d1107si348967pjb.172.2022.10.24.10.05.37; Mon, 24 Oct 2022 10:05:51 -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 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?1747589426052704254?= X-GMAIL-MSGID: =?utf-8?q?1747589426052704254?= 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);