From patchwork Mon Oct 24 11:30:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8745 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp427904wru; Mon, 24 Oct 2022 05:34:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Iivt3t19MEedGGKFCI6G6MUNZ+k2tRMOA37830eR2IGBTW0ZU7YQdWDYhF2RPJ6BwuGRE X-Received: by 2002:a17:907:720e:b0:78e:2b59:fdf1 with SMTP id dr14-20020a170907720e00b0078e2b59fdf1mr28265095ejc.659.1666614806569; Mon, 24 Oct 2022 05:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666614806; cv=none; d=google.com; s=arc-20160816; b=IvBVc9l36JNVyFxtigpLg4Jk3GH+cI+w9V2E0Li66dG5a6WmEjUXmLZvG9Z/qBHLL4 K+/cP2jXPPcpN95LYogQhFB5WK+AXzYGrF0H4y0Xe9IWbLZ0I9xph+TKDp5MA2PkRCg1 zwYKMP15yAArkB+l62m8GwniwIIBNfu9QQkNiJf9+P9WG9Qf2SGdxIplxFgTkYF4hKp4 XFXpR8spBMn+xJ3N5ZPNaGw7ndn2NeH3zt3iN6ECBoFbre3ZbEXxg06j/W0pYMbiuLQ5 qeSKtcxC3Vt2us1ozq7hfEFsLuCAYB3vQOVSU2o9tveQNny2Qg36Am+Kjquv2PJZd88P rJGQ== 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=9ZADA7LVhi99Pr0ZXgZLe1Zj1L6K0RecMf1X90kma1Y=; b=bJjtyRglLS6PthjS5IBPJDB+boSntIWCoOl3Fpq56f/I4Fm+YdHQr+m+noSTW+v+va lS5nzMjov5Mlp2KhVQ8fWX841rkM2iSrFa8v6c53cS233WJOEdDm5fhuRufknMT1wQgH s5Ym9WAbwpKfCZm6kFpTYERymnfQxTpKiZdvueVX4uBI0LRZ+lPw27QgEnOGJyVUGFVk Eeof7wdVvuj4WF6w2mt6Fxsj6Cjq/opnyMSF0u+3w7nQfWJX6xkqp6Or0XPPzS6fYR26 EfpoIJ3Vn4AlyE4XIgaMjqrQWxbj3vqv4+SEoOWr2g+3q8oJKw+qzTX58SiTPF6lwwE9 uyIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LuEH9Tiz; 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 m22-20020a170906259600b0073ced0e9bb1si25430361ejb.189.2022.10.24.05.32.56; Mon, 24 Oct 2022 05:33:26 -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=LuEH9Tiz; 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 S233679AbiJXM1W (ORCPT + 99 others); Mon, 24 Oct 2022 08:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233735AbiJXM0y (ORCPT ); Mon, 24 Oct 2022 08:26:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06BF38558A; Mon, 24 Oct 2022 05:01:15 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C106961254; Mon, 24 Oct 2022 12:00:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4497C433C1; Mon, 24 Oct 2022 12:00:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612801; bh=jGqOotVL1qkAVg5bb58qeCDE4j9sfDYzqT21ZmSUues=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LuEH9TizCIAz57LFEi0xaButqh4jV92FDDt8NQ9k/mK1taWmeVwfHhMj/oLlL/YVQ G6sW5FSoLB7kZLdMEursGAJZn9xldyuubRigpzpAraD/IynY4pEd/4/aBdUte3xTMj l98ySm5dMAeRbdA0mSFAl1N1JZtutz9dDvsclHzo= 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 125/229] clk: tegra20: Fix refcount leak in tegra20_clock_init Date: Mon, 24 Oct 2022 13:30:44 +0200 Message-Id: <20221024113003.050579336@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?1747572287643216563?= X-GMAIL-MSGID: =?utf-8?q?1747572287643216563?= From: Miaoqian Lin [ Upstream commit 4e343bafe03ff68a62f48f8235cf98f2c685468b ] 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: 37c26a906527 ("clk: tegra: add clock support for Tegra20") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220523152811.19692-1-linmq006@gmail.com Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra20.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/tegra/clk-tegra20.c b/drivers/clk/tegra/clk-tegra20.c index 68551effb5ca..5859b8ee1478 100644 --- a/drivers/clk/tegra/clk-tegra20.c +++ b/drivers/clk/tegra/clk-tegra20.c @@ -1152,6 +1152,7 @@ static void __init tegra20_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"); BUG();