From patchwork Wed Oct 19 08:29:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp251513wrs; Wed, 19 Oct 2022 03:51:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6WzHDKWwGPHgpmK/Usc+Pji2RBVNvCwm1yvJrJyUSB3bo4ts6WZEOwT4T2Uru0h6R2hiU/ X-Received: by 2002:a05:6402:448:b0:45c:8de5:4fc with SMTP id p8-20020a056402044800b0045c8de504fcmr6799871edw.133.1666176713943; Wed, 19 Oct 2022 03:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176713; cv=none; d=google.com; s=arc-20160816; b=BYEyi0rJl2XtXntWB8WFYWwk/Jt3xdU/twpxAePHehiIFxWWj86aYuqR74X7/QPTTB csm3GYeXHzrTTVtiDdtybtJRpzdFEq37TbGcG70u7lQHGejMVpqP8YWHUqcou+2+F89V i+8uiNO5lAAmng3cOzk/ujKlKxEb1SZE+vNhE1J8wsNwDHKGN6+7SFDNP8GB1Jo2+0Fb /8RnhEs0xpAwxhVXIc1azW7URGebltaijf4LlY1bTI5z2hrs+h8w3uMV68i5V7nO1VAK u8VIMhh7sFNxtFlAP7jUoBOQYC7u5tJbURWnSqT5O1sxPAF50x7aKDY9pk4ngO3roRaj ou/A== 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=ZGWNBlpJ/VY/Xf7CXYrOhZ4mFqAF0xjOiYVXc81WScI=; b=VI06y8jZShmZXL5PFRPMv4xhQu19LsfjxvOk/kk/6TVUNtLGrd7HTAOkRmX/vEZ/CA QTK36ytxcx80TSJwxtCC/MF2YfTSsXNYMFCM8FR9igwfsFq1YMhXA+4v/PNkzbrauaWy lWFzXAZJeDSuewVVQA8cX92lMWOiW0TFQcSsatt0qGkn+OwdcS4m4NcT1vuFteVnRFkX V/JRY2eMdS7T8H59rNvSTuY5TLO1nyA1tOF9NXLpxxsD5QkNpQUA8f9G9NDu7dJjGK3m 4IMiU7VQXtQDbfmD9WntbdkddQ908LzpXKgdMcDXetw4AcHGODKkJtd0l/ndPAmgcl/c QeWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B+OTD5h3; 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 z72-20020a509e4e000000b004596db363c4si14129918ede.264.2022.10.19.03.51.27; Wed, 19 Oct 2022 03:51:53 -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=B+OTD5h3; 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 S234426AbiJSKur (ORCPT + 99 others); Wed, 19 Oct 2022 06:50:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233395AbiJSKr5 (ORCPT ); Wed, 19 Oct 2022 06:47:57 -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 39A6D159D65; Wed, 19 Oct 2022 03:21:47 -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 C8D1BB82439; Wed, 19 Oct 2022 08:59:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43902C433C1; Wed, 19 Oct 2022 08:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169969; bh=r+FwyI0dw6wnWyUmx0/wuU+uiVosvkZ0FGImdLGy/tQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B+OTD5h3a2MV2jmvzMctVPNQgjjjTVCoNUiwgcIQurW99BjXgY4p7OqGWG2Zp9Oi0 naZc1+/jSIZehPwVFT3E3B+OJbmcuHnMKtztY53OhGrcbolE2bio/EfVJE6Nz/tVwY lXEwTF9XU5qHozoInF+BcSgIQ9ucGZH9z3+fp0WU= 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 476/862] clk: tegra: Fix refcount leak in tegra114_clock_init Date: Wed, 19 Oct 2022 10:29:23 +0200 Message-Id: <20221019083310.992544277@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?1747112913969274248?= X-GMAIL-MSGID: =?utf-8?q?1747112913969274248?= From: Miaoqian Lin [ Upstream commit db16a80c76ea395766913082b1e3f939dde29b2c ] 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: 2cb5efefd6f7 ("clk: tegra: Implement clocks for Tegra114") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523143834.7587-1-linmq006@gmail.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra114.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/tegra/clk-tegra114.c b/drivers/clk/tegra/clk-tegra114.c index ef718c4b3826..f7405a58877e 100644 --- a/drivers/clk/tegra/clk-tegra114.c +++ b/drivers/clk/tegra/clk-tegra114.c @@ -1317,6 +1317,7 @@ static void __init tegra114_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);