Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3325975rwa; Tue, 23 Aug 2022 02:54:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR4A77Wasg7EXId+qxBZPGqaS1xDA8MyjSLeeOVevrsLASd1j8vGGBBhMdGpOvrygSf2XIbg X-Received: by 2002:a05:6402:3583:b0:43d:6943:44a with SMTP id y3-20020a056402358300b0043d6943044amr2927944edc.409.1661248456803; Tue, 23 Aug 2022 02:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248456; cv=none; d=google.com; s=arc-20160816; b=g1btcJClKFU6sgKOY88N0vWQWQ03JepYh1ytnnefKxB+cZmCgSsuAXgebDwNCVz+9B bpEpdhbke8Xxxm7/v4pJa+VfocLyk4e4b2s2YS/R9e1mpLTnONQHktW3PKBLOWBOuPK3 5WzJyrDmObhKBPjTXNIlNSr6vpLOHEhSwxhimhpNi30P+81nxIpiGYN1SnKPKidhG27i uwbBYIVTnFH/pbmMr0EjJfnkQLe5DR62TdwX37lnEIBJtsb438nBVkIcL929pNaDhe6Z sd6uH/TZWk0Xt6ptEwylP/Gg7jmQnRnZ2GkFPGSrr1wUmHfX6qYc82izjWQf2PvdJqpT yJzA== 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=BYA/aRZUhd8O1GbFp0I2DAESvxts1/MMUdrsiBZUOhg=; b=dDO3cB2gI2+/yzXKw1jwJQU4s/94T2xPybrYOPSa7nynCdsEdwDV6oqyK97hrw2oUY 1xQJSmmwA/0ap+casKRu6v5uyPO3ARj3yDM4RGZFvB4JiuaDHKLVAF+uMdp2U46E/XYr hITmdQFF+ZsLnKR/I3t0w3EzQghIbiQ9ea7EVftrFwSX3pDpJJJ/BulH2icOPnRspNVv 3r+aLgv5iooC/7fBoJbrFsyEhs3tcGpz41W76NcGpZNxcExIg9KX6XB209RKQkF+kvuF c8DAkOiUUVVy74xnhQ2/KlbAUX0OT91zQNsYsALOFvPWVjtWp6JjiJ1BtHI5H/4wufsQ tWsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lrfVhkwu; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m12-20020a50d7cc000000b00446b57477a6si1483930edj.343.2022.08.23.02.53.49; Tue, 23 Aug 2022 02:54:16 -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=lrfVhkwu; 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 S1350819AbiHWJey (ORCPT + 99 others); Tue, 23 Aug 2022 05:34:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351080AbiHWJeC (ORCPT ); Tue, 23 Aug 2022 05:34:02 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C154B9569F; Tue, 23 Aug 2022 01:39:17 -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 sin.source.kernel.org (Postfix) with ESMTPS id 7A10ACE1B43; Tue, 23 Aug 2022 08:33:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75193C433C1; Tue, 23 Aug 2022 08:33:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243585; bh=G31bJPoYMv94cqbiSEOGE7aQCgluitafdoR37mIssKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lrfVhkwuadyjGKnT11ymvY5AR3jWk9ruXQXij0foTGjgQ6dyTFEc16IscIgIyEF45 iMUdU0UksZRvJW7s9TFccCOeYx6TsYgCq2Jm+AlGFbZIHCYWBkfCvoLTGcu1QOzP6P ldib5cLz8WSAR+/nHepKBmwbQAIJoAK9yhVj/m88= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Thomas Bogendoerfer , Sasha Levin Subject: [PATCH 5.19 323/365] mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start Date: Tue, 23 Aug 2022 10:03:44 +0200 Message-Id: <20220823080131.692729369@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Liang He [ Upstream commit 7a9f743ceead60ed454c46fbc3085ee9a79cbebb ] We should call of_node_put() for the reference 'uctl_node' returned by of_get_parent() which will increase the refcount. Otherwise, there will be a refcount leak bug. Signed-off-by: Liang He Signed-off-by: Thomas Bogendoerfer Signed-off-by: Sasha Levin --- arch/mips/cavium-octeon/octeon-platform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c index a994022e32c9..ce05c0dd3acd 100644 --- a/arch/mips/cavium-octeon/octeon-platform.c +++ b/arch/mips/cavium-octeon/octeon-platform.c @@ -86,11 +86,12 @@ static void octeon2_usb_clocks_start(struct device *dev) "refclk-frequency", &clock_rate); if (i) { dev_err(dev, "No UCTL \"refclk-frequency\"\n"); + of_node_put(uctl_node); goto exit; } i = of_property_read_string(uctl_node, "refclk-type", &clock_type); - + of_node_put(uctl_node); if (!i && strcmp("crystal", clock_type) == 0) is_crystal_clock = true; } -- 2.35.1