From patchwork Wed Oct 19 08:29:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp251274wrs; Wed, 19 Oct 2022 03:51:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72icDidzrrH4FmCjHbk/OrM9QdaI9h5K+6hbjkCx+vjQFjpZIJLT8O5hdENq5ymWlDJjjW X-Received: by 2002:a05:6402:3887:b0:458:289e:c9cc with SMTP id fd7-20020a056402388700b00458289ec9ccmr6863935edb.101.1666176672064; Wed, 19 Oct 2022 03:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176672; cv=none; d=google.com; s=arc-20160816; b=fu6zBxHJPyEufNU9hyF9vUpsVEKG5CYfxj2Z2W6vO/LXZiQ+vVX9XXSa4S5NdU1JDS QsakstL2gFPjtxm4sVyfTj+t2V8LGjpI0THa8CjvbYJ4MYCDcQe5tWigqPex9j/hkX5i nl2qBr/09LAXv+ekQIrc/I3zBKUmgLcAJHjD9M/d/e54YJTI0uutmmtL2Qkugcz9OhSv qyNSzQsDQVFzCZjUGpOnSvSfRzQ2Rpre0Ua3szS0QYJshMpVrp4esKQvsAk2555eg+UP HiZ2FPb2fz8mKshavopTQt0hhEF1KffKlXfsh07pn5tT7eCP04gqG0Snzt9xSVsY1q0D ANzw== 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=jsEfyFQKirU94htMd9BNVsMLlD45vinhDMQosHu/5eY=; b=SPk1EMm4gMxuXmkmpwpLDVJyrKdJXyXgz7vJIcqWpbMy/TYJY+9juZAkYQVfyOFc5B 6FsT4elRpMaFxDGhyrXJNgA7sLmMNCxE2Ox3ICMLYacib6pVTMVOnXqiFK/e3DW0Gcoj +wEPmQlw5JHK+pEZkQ1lUv5bX+V7jW5pyhhGzYo4L6+4ExZF/Z0vlE/N17Ocn+fcwfc0 GTpHtLqXzaXlnl0dB6L95Ui0tTj+y2qTL1bcvdpc4Iz8OMueD9J62gorvYCkndKtnSuk nHduop47LSo9XhjtcUcvtY5fPlAzEpybUdm/vQxXC8jMWwjr7S5H4RJzMIQVpsxC/Sia AlYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yMnP96cb; 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 ka3-20020a170907990300b0078db376206esi11178294ejc.783.2022.10.19.03.50.47; Wed, 19 Oct 2022 03:51:11 -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=yMnP96cb; 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 S231959AbiJSKtx (ORCPT + 99 others); Wed, 19 Oct 2022 06:49:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233513AbiJSKrE (ORCPT ); Wed, 19 Oct 2022 06:47:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C3E18380; Wed, 19 Oct 2022 03:21:43 -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 3F991B82444; Wed, 19 Oct 2022 08:59:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC3FFC433C1; Wed, 19 Oct 2022 08:59:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169967; bh=I9d031I2SDmf36pt9nJFhqyJf4Vp12w30552pTi83wQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yMnP96cbx7bvaR2UOr8P5eIw/VszF8L4QhuCtYZeK0cSPH4teg5ShgiYh9+Aya/nn aBqKnrxG8tDkqE4tZcd3A9dPq3fNvqm/LjmVUmkzM4PFNd+2us2kquJ4fASE26Safn 2j40yUIvlfzzmbmb+4ix9JXYfNI1CS9x3djVtSRk= 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 6.0 475/862] clk: tegra: Fix refcount leak in tegra210_clock_init Date: Wed, 19 Oct 2022 10:29:22 +0200 Message-Id: <20221019083310.941218380@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747112870035289579?= X-GMAIL-MSGID: =?utf-8?q?1747112870035289579?= 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 b9099012dc7b..499f999e91e1 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3748,6 +3748,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);