Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp668123iog; Thu, 30 Jun 2022 08:02:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uY0Nu9mieT4d4XmrkTcuIUDqiJnZGIdXDA37A2FOchNIvkpotWKx2lhgxjIEz9Mb192t11 X-Received: by 2002:a17:90b:3909:b0:1ed:1202:32d3 with SMTP id ob9-20020a17090b390900b001ed120232d3mr12788989pjb.233.1656601339255; Thu, 30 Jun 2022 08:02:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656601339; cv=none; d=google.com; s=arc-20160816; b=SputPY9FImyNP9oU87egZJVtWqVASmWeTuEvK8O1OWfdaEggyyeLLVYeXdsMZOqt7k 1xsC1RXYBd7bjrkhtHmxlJ2aL+EZva2r++niIo3fNfKvtsvT3ffqUgQc+qLZ+VBbdvhk F4Ay6pIi5+OQfFkfj40Re6D+N4sZaRdVTQBAwJFT6BgdNacuiqGL29nMtpJsr6i9Cl2f QFmn5GH9ImXXcFWhuRDCIsw2a+Lz9rM//3zcUmfUNm5Nry0AMNexKK2jWBAWl6t78ftG skQOplaRLNDWRC9whwqTPSU7N9cduKvpP4fwmq/tHSC1Tjte3CQ8BkFdWD4PVz3jnIWq xNcw== 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=P69SSVj2WO1kTjiDqfdJx2IqS5SpoJeFwnI0xXz8wCQ=; b=M3Xb6dLBOR3VnYIRE5znLO/iwwDREEWToJqPRSxTvFaTopEGToEglFxVBRqrcZUiPJ rXAfWPXXoz4u2c/60JRiTgZ9BTfqCgU+PxSGUThGwVE6zsfuZY/zMMEqMTxpj3vD1DKQ PLa2QQVJGZ+roJK6GLN2MtnDoZOutfG8uiaw3V4tFWlTnaqwYS74JrwV5Pi52p9vTbu8 /+uAm7c7qJWisHnf50pL15g8NNM5cEv2lR14sfxZx3C8H795ags7C7pKJbd2t9qB2nnm SkZetpOd4ouJw++7dSPdbbPt4P5kNkoHueYZC7AOrUmndN2g/xArtvdR/rUHurTy7PN1 12Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bpXj6gtr; 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 v10-20020a63610a000000b00411806188aasi6544471pgb.457.2022.06.30.08.01.59; Thu, 30 Jun 2022 08:02:19 -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=bpXj6gtr; 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 S235470AbiF3OB7 (ORCPT + 99 others); Thu, 30 Jun 2022 10:01:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236802AbiF3N7h (ORCPT ); Thu, 30 Jun 2022 09:59:37 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88BCE6052C; Thu, 30 Jun 2022 06:52:24 -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 sin.source.kernel.org (Postfix) with ESMTPS id C387ACE2EA3; Thu, 30 Jun 2022 13:51:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D539BC34115; Thu, 30 Jun 2022 13:51:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656597111; bh=tQbpvtEvCBc44itrMEC0A4dvWcUm/1NCxpin/Lzp79o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bpXj6gtrvMlYhtbVS1kFS39J5yIzBC3zd23vE+REsW+KpyrHxFEFR1S8CR4+E6Iu7 PBfEZ0tGMnPOUGOdEmAD7Vhs0+znHWVQypNa/jfVYIJWrM+PzU0QKDaLfdICG53NSH euNLpLTSqGhRFnISHkozMazAZmYk+Udyu/2bk5DI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liang He , Max Filippov Subject: [PATCH 4.19 31/49] xtensa: Fix refcount leak bug in time.c Date: Thu, 30 Jun 2022 15:46:44 +0200 Message-Id: <20220630133234.808305251@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220630133233.910803744@linuxfoundation.org> References: <20220630133233.910803744@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 @@ -146,6 +146,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;