From patchwork Mon Oct 24 11:30:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8439 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp401314wru; Mon, 24 Oct 2022 04:48:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5dMziaAag7lC0sd5azwkwtX0sfrBp36jeRvhn4G9vGXJRAA0nr2ecT6J2m80iQHYo7IbPY X-Received: by 2002:a17:907:272a:b0:791:994d:fb6a with SMTP id d10-20020a170907272a00b00791994dfb6amr27533866ejl.337.1666612107748; Mon, 24 Oct 2022 04:48:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612107; cv=none; d=google.com; s=arc-20160816; b=Qp9GzLQjUJf0K3/XtyhVkLI70w6Qn7spIDMPSI5oH01Ea6I43fAZy28saGQfkL/gMr +JiqNEiRUhiPaE0ngbWVVrTh0tidkkZm9s9VBlaUT67rpuUPaOW2cnd02R8x6PmExWih L1opV9jgov6+HeRX0Dgbgo+l0pdwWu/1gKR/j+nufuBY29jC+VXzkQ/5q3KZ7HnxMk3x 2hoDtN2+YIqQUryvBLgRPBLhL2/gvWfiE1GgA3HS7LR8rdImzo1xqgwcvMHKqgKA/64J yH5qOBvDua5K2pB7yK3Ofug2kmxzGY6kAS/dcjIiIlzW4mH67+dTlmkjB39a27mKGr5s FiYQ== 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=cs5tJDXEP89aZSi7DY0mX3HG7RYGnAhL+X7MivMUEHE=; b=f4sl1FcZMO6IkJY7dmhhLF26Qo/VpFimvIoDgpd/5DXM/tPmvE6UI7D8QA7BX6IElf 0taFe8QswpoePoUsphvnyCgBBTXaR9+cdoKOTgTkz8nWCjaaszS6LeN8EMncwHJ5GxvX NKMK720pse0E6kSVXP7XaFdmLr0BrpZ2dPFnufXSRy55skzzwDbgAWMFM2O2SIaYfHDC FoqRZEVF9P1kLHbSFXouueXfwPQIhk389SYL1mfGyyz6ajtPRJ1uTtokQpGRH5VWJsJG +fHg8rdSXOkHvyYOL3nXgDBud0+fO4DbFEqBPKts+VLqSRwJemn8AHsGQ/GaYs+j+xQZ hK9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=WtacQ9ov; 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 d6-20020a50ea86000000b0045c3592301dsi25399662edo.191.2022.10.24.04.48.03; Mon, 24 Oct 2022 04:48:27 -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=WtacQ9ov; 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 S231697AbiJXLr3 (ORCPT + 99 others); Mon, 24 Oct 2022 07:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231532AbiJXLp5 (ORCPT ); Mon, 24 Oct 2022 07:45:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6D0475FEE; Mon, 24 Oct 2022 04:42:37 -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 E5A1CB8117E; Mon, 24 Oct 2022 11:42:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43C18C433D7; Mon, 24 Oct 2022 11:42:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611736; bh=65y9OxWLOZDKRavNVEMFCUaCmBhr7AWP+ncg6Ea8cpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WtacQ9ovxKgoUqzVLS4WrpiuTDwZg9JzknYqHlYudoZoSKaHPh4g/qUJCjpJ3EjKo l1gjnvI1KGSv7RGV1RfGK2FhDvloK0kaGmVRhWZdrQfJzO+8EcOU2hvFPnWguKYKv3 OvBqH7B8DkZJW3jzKqyz0y8PMbrSSLkI71Kwn66g= 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.9 092/159] clk: tegra: Fix refcount leak in tegra210_clock_init Date: Mon, 24 Oct 2022 13:30:46 +0200 Message-Id: <20221024112952.789804054@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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?1747569457071087262?= X-GMAIL-MSGID: =?utf-8?q?1747569457071087262?= 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 2896d2e783ce..21b426d508aa 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -2706,6 +2706,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);