From patchwork Mon Oct 24 11:30:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10214 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642583wru; Mon, 24 Oct 2022 13:38:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4GcHhshpxtOJM2Efl8RuG6UrBnDbSTnxY0mSkWaI8rGLIn5D0Z7iBYaIXJfPNmsyg11cOj X-Received: by 2002:a05:6402:27d4:b0:45d:a69e:336d with SMTP id c20-20020a05640227d400b0045da69e336dmr32106297ede.298.1666643933874; Mon, 24 Oct 2022 13:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643933; cv=none; d=google.com; s=arc-20160816; b=Z4GssS4OGViUJJr6OkGu5bvvnxK9SdEbzgGgGMk/SYh9fLe9IxXbCgkF7wScKjzaJR 7qCiij58R3wpswgZ7Q3h+f7JcfNl33uLv/clcBKUKd+TNldcq+NCu+IwlAsqPV9+P5m8 Vrr2OPqTRHGccTHb5HyBlXnnCj2VH6/vp/4NRatePCj/cIq5Cq4GrhjbdpH/7H1+p/33 ukVKJy2rgLLnw2eFODa4gnHeVcM8YWisgZlvkun3r8VJCl4Oo5wh9AzjPXvNjTj3ygWs lig8bjOfEp+YBG7priepeyWj+KIcRXk2SiPpEaIfxgbqwWiFYqR07DttT5hQQlrn3TBr T36Q== 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=aXfnmRkZjqW80b4yH5aOF2PbBiqc8XllzV0xfP+Lupg=; b=bBqF0t0HbUoh51aPTgVDSi0ABycsLob4eBX6GeM2ZqM5+IU8ESIjQZvSaWQAY4HzdP hW275Fewdf+aj5gBQvshJ55Y9GGyxL4W5LqAs9kmh5Q/ENAvYe52l+T3EPR7wH9n80AG MmeoxglwZ1xYZTluPFgWuaw0h4zY24sMM+GfWcmR87K5hQ/3jjmBSCX6DyayKiM8MDe/ 5lZrNEy809EQBViiFaw3r9vY4x5eTrDQgtdVw2bd/Y7qJ1+LhQ7JfeechbhZLR43cvjY tnfihzkLlsGsPxGN0cne8hjG3AnEiCDjxHClAUR4PeDGAleM+mHlWfI5+RYrPmHA8Mto 5qEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d1NSdUUt; 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 i22-20020a508716000000b0045c3f5b458fsi725770edb.397.2022.10.24.13.38.28; Mon, 24 Oct 2022 13:38: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=d1NSdUUt; 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 S234511AbiJXUhF (ORCPT + 99 others); Mon, 24 Oct 2022 16:37:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234300AbiJXUg2 (ORCPT ); Mon, 24 Oct 2022 16:36:28 -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 53BCD18542A; Mon, 24 Oct 2022 11:48:16 -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 DAA73B815DD; Mon, 24 Oct 2022 12:11:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C846C433C1; Mon, 24 Oct 2022 12:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613492; bh=hhGcXY6v0OKrhqU0sVU5iboQdDo/0yK2fTx5k6H6Sf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1NSdUUtlsA1RIxLIqhURCiYvQFxDsxLMnMNtTv/5X3M+btp4hT5/cZjAWl87AmHo KSymKBHnTYXbPvIsNAEOFBztBQmv5rowpbiLaOx4JVu632lNMLX2NV8dU6h0bwA+rY atwvDMEPZEyPb1y2iW4w+BhXl9egEymouRZt++Vk= 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 127/255] clk: tegra: Fix refcount leak in tegra114_clock_init Date: Mon, 24 Oct 2022 13:30:37 +0200 Message-Id: <20221024113006.797144870@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?1747602829777398882?= X-GMAIL-MSGID: =?utf-8?q?1747602829777398882?= 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 4efcaaf51b3a..586b091651dd 100644 --- a/drivers/clk/tegra/clk-tegra114.c +++ b/drivers/clk/tegra/clk-tegra114.c @@ -1337,6 +1337,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);