Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1714943rwb; Sun, 14 Aug 2022 10:14:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR5IJf1C//W0QKQIGDWr8988+NFFrOSJQey0IcPzNDY+kwlucynhK1rNtOHRQdYgLtmh1c4k X-Received: by 2002:a17:907:6e22:b0:731:152:2504 with SMTP id sd34-20020a1709076e2200b0073101522504mr8459126ejc.545.1660497243073; Sun, 14 Aug 2022 10:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660497243; cv=none; d=google.com; s=arc-20160816; b=Iyl9of4Ht1NuxHAnStm7Yj/bkcdsCzMfS+hJvbPPwCHoAsflRfMeCHH8jpD+WSJHPg zm60qCthjyU6dZ3lwuKyUUCkGn6blxOzi7wQq85ZfFWibMDIYTBAcDDpxETXTg1roVEW Je+uk38j4paJrW4ftlgPTS2exXFKJTrJVbVufVTu24Q75xG0wAMaDrSsCN4c68jgoDzD GlrfSDhoANxTBzYT/ZUlli4h7IurhRe2Xo1bY+7HwSkeHOmwp1xBU5pSAx75izhvvt8K vagap2lN3kNAgJvHXlYE7zIchXqBBc4bvghHliTYTMqjWJWyxPVS4Z5P++Ce9X8LX0A8 jFuw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BYA/aRZUhd8O1GbFp0I2DAESvxts1/MMUdrsiBZUOhg=; b=kVD1/xxBZ4plRYOw/wHoYkvzI5DFbhN2253A9g1/uS0IyGVb/F/bOL4m0esA2wHOue nnStUeWtgpb11hJYh7F2o5D3J73x1dD4jhzM4oO1IW4RWS20PIlU81zgbvYRfRG7y0Ot iKjwnz/ZCU/NST8SoNI6lQDlpnrmn3zXy/jKkTsLG8kfz0qyNg8A+mG4m3GMWy915q31 sIFiFqYtJDjX04mc3m+wtqb61uMca0Q5IxZYnuxlXG3YlqkwpYs32uXll9/8oaRwB9dF rij/5fAkYqaWibXyy5+IcWtNx371WzLHRHVxjqD44NXhIQbDca6iMEx5O99+agGKXy/l ZONA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=J7FNs+B1; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a056402440900b0043d0b0de3f3si6815434eda.532.2022.08.14.10.13.36; Sun, 14 Aug 2022 10:14:03 -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=@kernel.org header.s=k20201202 header.b=J7FNs+B1; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242697AbiHNQeF (ORCPT + 99 others); Sun, 14 Aug 2022 12:34:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242994AbiHNQbp (ORCPT ); Sun, 14 Aug 2022 12:31:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE4ED23172; Sun, 14 Aug 2022 09:26:21 -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 89F9A60F97; Sun, 14 Aug 2022 16:26:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33FDAC433D6; Sun, 14 Aug 2022 16:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660494380; bh=G31bJPoYMv94cqbiSEOGE7aQCgluitafdoR37mIssKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J7FNs+B1e/d+8bheLHs3uHsxEISz5My45gUlHIDrcsK/KPiMxJZYq/UPRyLRluFH2 ap2mXFn9xLkeFtmtpTRBenMkDjCgYy3izGqNgr3WBzyDWhxvyvbzy3nXiXAlP/YABL vb08oiV9dnoVkACWG00oBt32SWvQWqLQGpJ3PAeC110IU1QoONCxWbICKpSjs/QZ+B 2qLsRc8s3M5IG05encGRyH81LCrfFNuosQIpbv1iQt+Y2ZyRt0lOwC0C//ZhQwozwf TvjA0YL0zt9/QejiVnRkbh5AOcXF8pMDWk0wSXFidyfq8edTDoT7Tt6kAZl/Jsj1lu /rf87n/CXJsfQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Liang He , Thomas Bogendoerfer , Sasha Levin , ye.guojin@zte.com.cn, linux-mips@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 05/28] mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start Date: Sun, 14 Aug 2022 12:25:45 -0400 Message-Id: <20220814162610.2397644-5-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814162610.2397644-1-sashal@kernel.org> References: <20220814162610.2397644-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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