Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3404261rwa; Tue, 23 Aug 2022 04:20:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Qg4s04jmeEGQXIXQQLJ4TERILgnfnZMP+UBD8KPVe66kWs1rfwwJMUk3tne7bQoXLzcST X-Received: by 2002:a63:290:0:b0:41c:506f:7ae9 with SMTP id 138-20020a630290000000b0041c506f7ae9mr20538585pgc.373.1661253604421; Tue, 23 Aug 2022 04:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253604; cv=none; d=google.com; s=arc-20160816; b=i7y79OoYdTNG5yVPcTNTdHvUcj7AKvCRLlQpUPr0nfg+Ic7+axsKtz2ulKXSg7ccnI 7Z6bZQ3HLOmD5oRtXiYOQx/GPDlcBWmGDhS54SLpEdEggH6fDB/7lQMrq3xNe5s8FF6r 1J0CyB73DSTnPnbFegpinUoY+6JR5TI4opH/EmNb8aNY0L5I6L4dTvYyK70kZrl5O1zT t/2kMhNA7vA19nSdXO2K2fzpkUVlCxLfwhH99G1GLw+j81eSpBnOJ5s6U5qBZNyBgHZP BKWNWwvIXW8k3OLZAi9wchFxugYyvHWLcbzNK6o9B0/V+wosc7fJbdCfTGKftedXbjBx bEhw== 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=+dTj5ULCXl98eoz7V3pCTBOCb3tE9ZB6fGt95grBJkE=; b=Ikwg9+pyd2spw6vCH9c34XeYUhauADaIcjPGvOQHb+gmIQNINaJqJiCl0OuSaT/oVW A0fL2j3hai1VNrMrBR54WlZxILqDFMRsKL92hutoxANhPyi0EfFgEO3AQreLIa5xKPgz lSbHyHeX1qa2VfJ4dMsrttORc6jEzLMwqM9SrEY0m+zyyftoBB5sVW3ayH92kpLMiD6E 0bWmweG4NZIyTpQpOfHayLILzCbLRd7oBe2z9X3S2Fj0IyQAm7bz3EZaHgbFoZL7MG5q TRhvyrsCH1vaIwLy1CK5hxiFodtTeETQS4K8jAD3M4dvAoO0T29GLcOtL/nNo1D1l9Om cr9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z5fJS9XQ; 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 3-20020a630003000000b00429a7919f37si8726348pga.458.2022.08.23.04.19.53; Tue, 23 Aug 2022 04:20:04 -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=z5fJS9XQ; 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 S1354916AbiHWK0t (ORCPT + 99 others); Tue, 23 Aug 2022 06:26:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353790AbiHWKMH (ORCPT ); Tue, 23 Aug 2022 06:12:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8391CAE43; Tue, 23 Aug 2022 01:58:25 -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 0FDFAB81C39; Tue, 23 Aug 2022 08:58:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DECEC433D6; Tue, 23 Aug 2022 08:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245102; bh=EDm+cXKravyMKJOtAFbZaSk7wAygPsVXHZEc10Upyg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z5fJS9XQWaWnNrTgVUaGlP/Hm6J9TV69ActYBvJtS4BWd2dQfe+UAyjcYThX04rWL X6nLqh4fOpFjiY8n5P/XqHbyp9ItnzlRHW+YL5+4F7PGs/Jd7VIAjHybwYOKjmzS37 nlGahhpaPwDFN2nxTFuxlXKVVNUIB08yQ8GvDfhw= 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.14 223/229] mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start Date: Tue, 23 Aug 2022 10:26:24 +0200 Message-Id: <20220823080101.605361180@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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 ed42fc27033c..f2a1c316608a 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