Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3469914rwa; Tue, 23 Aug 2022 05:24:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5c0ZvYrzKCEkP27VHtKg/L3kYaSg1Af9iL/U9BFfCv1U80Npd+cqPgHbJ5DqHnc7e+ffqE X-Received: by 2002:a17:90a:1b69:b0:1fa:f9de:fbcf with SMTP id q96-20020a17090a1b6900b001faf9defbcfmr3013234pjq.201.1661257472459; Tue, 23 Aug 2022 05:24:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257472; cv=none; d=google.com; s=arc-20160816; b=RcqKmYVfSpfZKUxZFJWrz9HVOl928+eQWXGccyQK8nONx2T1qcFI2bUXcWQhrjAl+6 G8DCWsby+tyFUcFumn7054wPUSc7MhV8wM1NuZ6Ud9Dvqymjkm9MCjqHw8TkUXeJewWA g52PczulYanGE4jbJLf1qaedfkNno3+3PagpijRa3u/px7ZOT5L0fCtlxw3AX8g4rm08 mwsLg0Tf2+w6YGxMTV8rLjFO1MRN7fB5lQIJdGWOu9BdIBJ+FOQrZelnhgyBbzUbnbtN OAYQygZP3O2nVWfuMcydeVO6/y8pSdPT5nzrPPkWDIHC4BD1viqOzZpnRK/T8eg4AFjC 6D3A== 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=+7D5GKj/50DXVbHkLB78e3yJ02NCsi+qgZyPYy19UAU=; b=0DXBcnqapli/6+xBkCT+XaGu6vX2KOPVJDNjXX3G9OUJTedm+UZZQvmRGcHRLWZF9w 6Z24+rKLw7GA0eN89aZsRxfyGWMUi0EXUAWr+uF2jMXHVCXOO1zIGXCPq7lmceQtQ3wO ivM20ClQXMvjYl2ncKVZmVmiPv1r/Y4T+xJEWiND2c91Hz8COHSR8kPtv8WbRhQi+LbR RKFFYUCCRZqBIcFSWmuehlTa9MXLL1IlokoGUuXF8nuLqdatMOjmIr+1isJf9xi7rnr8 PS57gGFp/uNMszCjWL0Gtkb2neBjy8YwLcpv8k+ZddHEfCsxWfBF9SeRY8gZBS4yzvxv dt2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YMOcSd7C; 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 k22-20020aa788d6000000b0052e068f159bsi1468760pff.145.2022.08.23.05.24.21; Tue, 23 Aug 2022 05:24:32 -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=YMOcSd7C; 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 S1356668AbiHWLDf (ORCPT + 99 others); Tue, 23 Aug 2022 07:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357397AbiHWLCQ (ORCPT ); Tue, 23 Aug 2022 07:02:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 441A2B0B31; Tue, 23 Aug 2022 02:14:55 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E5E4B60F85; Tue, 23 Aug 2022 09:14:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF335C433C1; Tue, 23 Aug 2022 09:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661246094; bh=H8zKAP2GVQ+txb/T0C5yinAoxu0tC3loh6dAjeV3vrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YMOcSd7Ck/XlfhrP3TTJWXcr4Fq3516xepPnM7mBUBInBSXmp9YEf8j10XloLk+HE 5d/2NFn1Vi0WhugmTvp/G0JFsqmsK5ypKG5360ha131AIOn2wKgnUyTGiVIGkiX0/c 83UrnDzMYWoIgG+WPaVf3qH4BCqSJctlzcsnS2Cs= 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 4.19 273/287] mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start Date: Tue, 23 Aug 2022 10:27:22 +0200 Message-Id: <20220823080110.583375750@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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 4d83f5bc7211..54c8389decda 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