From patchwork Mon Oct 24 11:30:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp512394wru; Mon, 24 Oct 2022 08:27:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7LPJY71QsgQDjV0hW9x4CPQKPwuvASETqeFh6Qv7/JPq8AgMvNOQem6YzwiJwEGglcc7oM X-Received: by 2002:a17:907:75c6:b0:79c:d3f4:4a14 with SMTP id jl6-20020a17090775c600b0079cd3f44a14mr14506536ejc.61.1666625279213; Mon, 24 Oct 2022 08:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666625279; cv=none; d=google.com; s=arc-20160816; b=ckrl4a6B96539G1u5UaI4ZmqCfsp4UaNOtv6NC9RbtvQ+VfTCwzgvTgbb8GLM3LgGb F2QkB5Slyw55AsgIUFrIrOrW2DD25M4BmRKsD1kHHNxCGIC53cCufLgI+SZ+JBpauoct FFLMpmRfg07TspdU4zkD1zRyqtZIvOnJFnlKHLMLX96LPkhcA8B8iqQJWXsCtrBG++Lk Dd28s/44VZW6/gvB3eUEAEoM4Uqa4iXg5gL61kXonytTbv2NtjOhMy0Gp73HqDugJis2 Gt2/oURzGbowyx0K6PxBOqXpIuzgeNtHYyFLat5Druuyq133YiAFiK5NaSrIWKzgZnEv Il2Q== 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=cKZ4oQExA+8BD251kHlXtMX5j4Lcm9mNaE1/Uu7ENb8=; b=PQH5+u/Koqhg65/yl5//uF+7xMgSMo6oG/Qdm4+uj2atUU5K1Q6m0rzAsNHrvS3oZF M3xf2Pi1I4TippNc7OCsrWCEoAdham+jGNY+XTGMsUNrmhiEKlmvG89+YQHEtk/uTrsf 1MQSNcncRYDxhsogRYnXVKZxZbx3+eS+a/kqWz7l0Br5CnjCyD/YpCQsMxIoYJxxS8J5 quAh2U3K0lyQrixO6z0K1/0r3CQSO7XUrDaxQ0ryTcMMZXYvA6HnrexrCbsVnynGKfpi qFmUJeGcP+gLKd15uoq59Ixo2cC9N8fCN6JHqDvXNuH9Is0MfNbl+IWZxdBzVc4+VKeF uEEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=s+df8uSL; 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 hb6-20020a170907160600b0078ca7bbf616si26219ejc.746.2022.10.24.08.27.34; Mon, 24 Oct 2022 08:27:59 -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=s+df8uSL; 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 S232212AbiJXPGZ (ORCPT + 99 others); Mon, 24 Oct 2022 11:06:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232242AbiJXPGF (ORCPT ); Mon, 24 Oct 2022 11:06:05 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F046F814DD; Mon, 24 Oct 2022 06:42:54 -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 sin.source.kernel.org (Postfix) with ESMTPS id 06882CE131B; Mon, 24 Oct 2022 11:50:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19937C433D7; Mon, 24 Oct 2022 11:50:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612226; bh=FkJzQqyuzVINUw/JtDrOgZ4bFtKbtqYn4qROJOxUE/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s+df8uSLAaBPn7jmFlUEGskw+BocKpjUlv5Yq+iycRwdgXtDCIe2fBa8qlFPZlifl UQWGPvXe5m62G9ODAeMKQ+QDuT+UV2r/TFsRFlTXDXvJy/pg/yNyajM4h+9WMLyNKC iLNl9g35icQB3lKboG9JfWZ1lsc5LqJUAiweFjfo= 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.14 118/210] clk: tegra: Fix refcount leak in tegra210_clock_init Date: Mon, 24 Oct 2022 13:30:35 +0200 Message-Id: <20221024113000.815596438@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747583268805545159?= X-GMAIL-MSGID: =?utf-8?q?1747583268805545159?= 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 cb2be154db3b..8aa400d04c6b 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3130,6 +3130,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);