Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2926588iog; Mon, 27 Jun 2022 05:56:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tT7Y2gm0OxpC/1slFNUc0kox3X98BSOM6kcK9/MwMIqP12O/0Bxdk6hN+1AL6+g1rJFEUD X-Received: by 2002:a17:902:e052:b0:16a:1257:152e with SMTP id x18-20020a170902e05200b0016a1257152emr14671489plx.172.1656334611651; Mon, 27 Jun 2022 05:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656334611; cv=none; d=google.com; s=arc-20160816; b=OELBniuFS01dCugwtEWx2gNwznGemZv0PJW2aDoCJ1PCeKYyAg1RjMyEwTLDUEH2U7 sdC1qcPRq1V7WIdYG0CuJO0KpXYjp/irawbe6zJvlz/Y073Y1HsZ5VwpUuadaGQ1waSh n8xOt0A7xoYJXnrGnIXXwsUmetVUASXg3JersbWWqyMhdfVHsosJrWwUS0uXq8CMwOvX E92SnIESf3962sItB+Agc5QFoq89fpUSFTflI1UqFNdIGMzfjRmWCZcUrVj8vieVbUOI kEtwcDAZDA+aoUNV+wBdYkhQL2ZfNbVE7uOoBcdEoGD4ALoKOBVQuY5JLHXL3bKIBLXJ 6dCA== 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=U1sIH2J7w5NuZGPINgDC3wvLvMAxR1rIf93zMuToz7w=; b=T0SW8UU46sAl0VM5Ssu4y+iJi/rYyiDUISrBT309RdOuJ0Oej1Ld48rfYqB80SUU/1 p1v0s510wYTFfn0scJv+nPP/6hoEvI9dntx4uYyNlrv/ZkvIjk7G3y+ebPOlAzoaD6qW IIBx1Cys5AIS92wMSuleNPDwqq8pysIOdqoDic//sdkoDjDmM0n2Yssal8QLIwB774YN kFbV406n2EO3Xym4AHYmWlO+JCUk1BJWhBROaXCgnU/909Oca8gbCgN1/2C+VX2+kh3m 8PR7y+0GMx0buHpQEDZGijsTWlLDrz+BckvT+wPigWXKJujFI954Lie7YVJth69XPrOy yyuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cqnuVxpL; 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 m2-20020a170902db0200b0016a4516bd6asi10230096plx.34.2022.06.27.05.56.39; Mon, 27 Jun 2022 05:56:51 -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=cqnuVxpL; 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 S235469AbiF0L3k (ORCPT + 99 others); Mon, 27 Jun 2022 07:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235085AbiF0L25 (ORCPT ); Mon, 27 Jun 2022 07:28:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E25F69FC7; Mon, 27 Jun 2022 04:27:41 -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 7E81661366; Mon, 27 Jun 2022 11:27:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92029C3411D; Mon, 27 Jun 2022 11:27:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329260; bh=0u83o4b8jqVxJj96kjDZk5MoeLJqvngsmEsDtEas6KE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cqnuVxpLB5lWpzza5r1IoAwjtAOvOoaKJ9PepWMIOdFUwz3O6qSoaDf9CiK340Zno eSwWonxUL8wbsd0/SXZPL2prZR/Qu6kRpCsdDWuIYfMfbvB3Xg2znzP6yd2rpH30m7 nE4bD9Vw8wtdIMb6bzVj9alRILrxHdMoHkv6ODXQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Max Filippov Subject: [PATCH 5.10 086/102] xtensa: Fix refcount leak bug in time.c Date: Mon, 27 Jun 2022 13:21:37 +0200 Message-Id: <20220627111936.017437780@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111933.455024953@linuxfoundation.org> References: <20220627111933.455024953@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.5 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 commit a0117dc956429f2ede17b323046e1968d1849150 upstream. In calibrate_ccount(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore. Cc: stable@vger.kernel.org Signed-off-by: Liang He Message-Id: <20220617124432.4049006-1-windhl@126.com> Signed-off-by: Max Filippov Signed-off-by: Greg Kroah-Hartman --- arch/xtensa/kernel/time.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/xtensa/kernel/time.c +++ b/arch/xtensa/kernel/time.c @@ -154,6 +154,7 @@ static void __init calibrate_ccount(void cpu = of_find_compatible_node(NULL, NULL, "cdns,xtensa-cpu"); if (cpu) { clk = of_clk_get(cpu, 0); + of_node_put(cpu); if (!IS_ERR(clk)) { ccount_freq = clk_get_rate(clk); return;