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: 8601 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp419524wru; Mon, 24 Oct 2022 05:16:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZQlEABS77LWJoSGqeHPalrB2McpL8m9jJeFddT11ywghHi69XhFwoVdKdtsdvCEQeHDU4 X-Received: by 2002:a17:907:2cf5:b0:78d:f9cc:794a with SMTP id hz21-20020a1709072cf500b0078df9cc794amr26092866ejc.577.1666613787497; Mon, 24 Oct 2022 05:16:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613787; cv=none; d=google.com; s=arc-20160816; b=dV+NkTu01VVC1ONQQ2Zjq/OYTDKqcWcd/u4skys6wtfq9O3jnFHbuOrScD5RWJgfDx RJHNk2pdPGVkR+uaOGAt4L6byY7Q+ncVhbjvbnCbZAjhZNIpWGg+MfG19tSA6BWxzDj0 i+cS8uOWRvoUO4+bpFF2kBcFWHjVNSayOsoqWZjZY6d9Jebon6kkghrKRW2fwObQmhep Z9sStYiAIrIheDW/Tam0L7/LsVjrOe76jEPWQsNcLkfOURsdWVxHQ7JTISpyJ8Le9c49 tik4P4sRSkAjwVP/dQK3kbmz87EV6AeEJVydbcZLbiLVnNWtA3SsIrWMaLbDfQUFJ0mX 3T3g== 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=8c1j/M987/nKWBPZqILrwgvxQGNxgsfOaNFoR1kvF1g=; b=XwXmZOR31Q5K3URY3GudrUm/5f48bvnAtKGBFE1lyH2hMBv2zsbMO4ZGnzaW9ERNN5 OKLF63DhVqQvEoqIP9qvuNArUtYQsaLBr032GFstdEqT58P/U4VQID0dhlL0ZGK8Co28 KpPfgwCUAuk/dSiHYUNpstq4l/NnAhDADxB10TZEkYAcVjx1/Hy+3wRemw1chupDyj9p Ggz1BB3SD+HpRRQQjMABhl2LZVX20F61I+cFE13t8qFeQ3FCoh27iE4bItHyHUxcmqLz u5xUQxU8azh4lhLoeWyRbnramTcGMSBiWkf4j+wxwd6oxYhXkc/dTLu9elMbKBRz0s/N BJWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t9w4b3nu; 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 wz8-20020a170906fe4800b007aa0798e081si1385088ejb.394.2022.10.24.05.16.03; Mon, 24 Oct 2022 05:16: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=t9w4b3nu; 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 S231396AbiJXMIA (ORCPT + 99 others); Mon, 24 Oct 2022 08:08:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229936AbiJXMFJ (ORCPT ); Mon, 24 Oct 2022 08:05:09 -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 B263A7D1F1; Mon, 24 Oct 2022 04:51:33 -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 07CB1B811C2; Mon, 24 Oct 2022 11:50:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63185C433C1; Mon, 24 Oct 2022 11:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612231; bh=+xRN65h8XMr3o6/9muZHdrbyw84AGq59Ye/oG3pC+jM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t9w4b3nuipwro2rbGguMhmxDNvAvAFX7w1R+h/kqLNKkGle/AsYYf3zPCllSypqYD +DRcIRdkS08phfsYt/0O9gX+3VudrNrre6rzZ03tFOOGL+pBj9w78ynYaj8todbf3j ux+p4l9rbcNHvluPQbsMUvQWoqGztnfbkntyMvI4= 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.14 119/210] clk: tegra: Fix refcount leak in tegra114_clock_init Date: Mon, 24 Oct 2022 13:30:36 +0200 Message-Id: <20221024113000.846085929@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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?1747571218661620901?= X-GMAIL-MSGID: =?utf-8?q?1747571218661620901?= 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 fd1a99c05c2d..8c071a8fc710 100644 --- a/drivers/clk/tegra/clk-tegra114.c +++ b/drivers/clk/tegra/clk-tegra114.c @@ -1343,6 +1343,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);