Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3415032rwa; Tue, 23 Aug 2022 04:31:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR5UPgpIfK002cg3BvrKSjY8Ba3iOLbvmkAIaaU+xmRdCYbhCscySvN3YLRS9hyX4PHNIqux X-Received: by 2002:a05:6402:2788:b0:447:3383:7a35 with SMTP id b8-20020a056402278800b0044733837a35mr557716ede.23.1661254269548; Tue, 23 Aug 2022 04:31:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254269; cv=none; d=google.com; s=arc-20160816; b=VKP3oc3WP+adSfczfsI+Z12XgXufzy1mknW+kwoMoZ2HA0x0OSXmjUi9isgbFe+EbD NUU9vmsPyKfo8apjM8FvxpVFViQmSTyK4tVZcDKpIAHbUt5GUaE4VBZUBsOLTzhdZvcs B8ubBI/SWMsWNKsvymqiKRyeL/FfcFDZ9TbmojI7zS6gBkkXw14IyUsw2RSn4pHOgtHe HSHsefIihYJvsoKo58KIB8ar3oEXn8g7EagZNVMep5ugyCaaXGoV9BeviTnX8M2LxfTN HjRt8gw5x2OOBwpRTkgdn6TbiD0Gm6Ayc5ceXvE/oCULubxQvMuMawTsUm9Pk/8ClXtD B1PQ== 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=nd4aVtxiyME51QWXe1atRcutyvcxFgAp6jRn9SqIIignDfBkjn431jrk7PgrZYSe/n BdLmUmT7xXE/joAHmHspDxFtkdmUhDtkPIzt++Cvhwdv72K465EXsK/r7z/YVCJd/7tY K7wOrIw15dNmu/6kRjehvTYkpbBuuBYsikF/84vU2xcL3nXbx3OfvK+cnOQ/SM1dUsWh PBlifvJlVCUBpdC8vEi6/3z5ZTbNaqc4izXiKM3AcHMjtLjlGB9Ca19U8MkGRK5PX28x eTgfUNINgWu7AhZZTbq5P1JUUTsQPGDapBrtjt3tnUECBsBTbbIQaZG0HcgayIIxt0AH QYzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fWaYuZ8U; 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 eb6-20020a0564020d0600b004359f471717si2261992edb.0.2022.08.23.04.30.44; Tue, 23 Aug 2022 04:31:09 -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=fWaYuZ8U; 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 S1354789AbiHWK0X (ORCPT + 99 others); Tue, 23 Aug 2022 06:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353673AbiHWKLv (ORCPT ); Tue, 23 Aug 2022 06:11:51 -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 8B6A27F090; Tue, 23 Aug 2022 01:58:12 -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 43CD5B81C3A; Tue, 23 Aug 2022 08:58:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E1ABC433D6; Tue, 23 Aug 2022 08:58:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245090; bh=G31bJPoYMv94cqbiSEOGE7aQCgluitafdoR37mIssKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWaYuZ8UEiw2vJoDIGoofyZP2drlTFB6lJ6TN46ZGy2CG9OynMPdRBgpVrPirFEEz PfbdbkPDJwWr6juREl/1QxnzVLwmjlkRJ1tIOwQszE/a75mntEvZJ0MwWDfZi815DF mXTRZ0u1SSdMfu6r2OABOuAyFpgtY6Qu1uCOPn2U= 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.15 210/244] mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start Date: Tue, 23 Aug 2022 10:26:09 +0200 Message-Id: <20220823080106.513640431@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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