From patchwork Mon Oct 24 11:30:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10258 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp643816wru; Mon, 24 Oct 2022 13:43:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5bHkYGCRD6FWZ6qvxt51VzEPopPvEVpuhuQo3finrl07FlxEqbs2wSjVmO9gldKxj+x8oR X-Received: by 2002:a17:902:b945:b0:181:c6b6:abc with SMTP id h5-20020a170902b94500b00181c6b60abcmr35340941pls.75.1666644179724; Mon, 24 Oct 2022 13:42:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666644179; cv=none; d=google.com; s=arc-20160816; b=zDj0ipN4xbx/ktOM0HceYuCldSvQWOU+mhYhwNreUKyGTg+aDDfO500V9q4CWtgfiH e0k+0z4WtwS4tEf4qT9b0kBz8mzWB0yTL3t4guNbZqQo3pGxtUXdrlR2cSIPULvjZlc9 3dnTXUITFnXav14v3CPgAMG2oF9H8ArFPajpKEibkdCiqKfIlN9PR6rYYBsb5YPC6bi3 8L2erNdCmS7QdpR0Tx9ocIqP7H60CtZFnx+89RI42s0blcSqshV7Fl82ZIH7k0zx3OkH pXCc+WjnjpKVUIgJ1jSJZ9wV8QzHSZ4DRqj7PY3Vm6dD1BNEENHiK+s3lT5GRopqFenh vb+Q== 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=/p5Ujs2KqcyALA+Z97agTpQoh8vlr97IKoU55BAue1Y=; b=TJhBHqcGIqUOPW0GpBxkW8WUAXOC66LYM2Y7cGuEk9lQR3VHBIimO7rbNpekmiVPm5 ukLbEckzR/vP+5MkRADBXSyi2oCIDKWMRpva4cnk960orU3raXkq8qKFmgXx4zZEsN3C H5Yd4l9N9NDTT2EcYvHUn2C0CsQcXeLEGH1uLbGqrnWTUFU+NR+zDpj5duqPzyMoLVYJ 7PYnP5INUfi2tYjSXHk8m445J8BhcBJV8D47Cob3PAH49fZZj1MRr21WRBGejeYEPMDo tcJAoy8/dFBXgNV+pSvSBbUWh30GqyPZi9NszykFAqcZkXcSwRDV+sXA7m18I4gLavlj cJqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QtYNq3b9; 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 mw10-20020a17090b4d0a00b0021336b17122si896982pjb.5.2022.10.24.13.42.46; Mon, 24 Oct 2022 13:42: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=QtYNq3b9; 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 S234994AbiJXUmT (ORCPT + 99 others); Mon, 24 Oct 2022 16:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234880AbiJXUlT (ORCPT ); Mon, 24 Oct 2022 16:41:19 -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 7AB2AFFF96; Mon, 24 Oct 2022 11:50: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 47996B815A3; Mon, 24 Oct 2022 12:11:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A399BC433D6; Mon, 24 Oct 2022 12:11:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613490; bh=67SwH3yl/AFIQ+5gVJObOOoTwx5eMWWZ5Rp5oyWalPo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QtYNq3b9lNBsVKOdUkng1Ib9nzBAEw6sEh5Y5ildhnEzKl6JEGcrZRfySzEJLv573 57bQX6aAfdmPVZVaTaVrukLqQDuhKFhtoONujA03nwtcrFVAbV0BysBz5wx9Ny4p0Z xzJdPpppDR+uQniwhhK3I1vgAmxsqYOhmRqjPygM= 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 5.4 126/255] clk: tegra: Fix refcount leak in tegra210_clock_init Date: Mon, 24 Oct 2022 13:30:36 +0200 Message-Id: <20221024113006.754561168@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747603087247956143?= X-GMAIL-MSGID: =?utf-8?q?1747603087247956143?= 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 df172d5772d7..34155b5b994d 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -3523,6 +3523,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);