From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BBDFC433EF for ; Thu, 30 Jun 2022 14:02:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235552AbiF3OCC (ORCPT ); Thu, 30 Jun 2022 10:02:02 -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 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;