Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2910870iog; Mon, 27 Jun 2022 05:35:44 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tZpPmJGEmcamPw8bf1eQrnrXBP6yUBm+H/mFKZc6hrE1GvxzEGbyXgCLmTcgam8IeW0yK4 X-Received: by 2002:a17:902:8211:b0:16a:43ad:b832 with SMTP id x17-20020a170902821100b0016a43adb832mr13917589pln.165.1656333343850; Mon, 27 Jun 2022 05:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656333343; cv=none; d=google.com; s=arc-20160816; b=mB2/1J3Gr1m/2Dj5qT3SvQUU7DwZv/BBhsfBVa5kvUJmBY4gTiAn4qu7RaFkh2LoYT hSIGpUpVJl5P0h10LILnncGjFtCnw7aX6YgCX/E1jmbOUs3gpqVfGX6iVeSOqaUbrwMn EKo3KfSLv6xQ/hC/DRg65Gj5Hn6JTjIi5cQ7oPIfyQyoWR+G70vU8UiI92CkRpab+jKT HAPZs1Ufl9/P584Rtr+vUBVngHSKKIeSbaa2/wkBF2AcnRUrS3Ew9o0A0oFP1nzsuQKm V5HaXY9IAUEH3PBP40q9JUt/5Ze3VWDveEjFBcwEt1QmOk+IXlLKuKn4kbUx9u0X4ANO GNVQ== 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=o96fsPFVUHUp7GIuIW9FLIyYehgOe5XpzZOJ8AsYaos=; b=Az1Y4qEzwokZFEziLiBjJvvv/SYhR00Cr5fxSp42X4hmMdjqpvzAmOT0iALF+eID5E uzi+YFHGdTRrX2KTpa3AXkT9by9lzVz60wAF6y1RhjOowvObp1tgFso2YIPXcr3B/Fak 2qGxT9/xGYOgV4pVtFyrgfIyKAH9lRM1yDPTmhoVKst576WJRoRCH5vDLOmlByws7BRR R9Xdg231XlwC4HDRo5UNLppC2M9u1VP42VJY79+TYYa+kIVGZg4eIteHhZ+Ncu6miPVx GOKOE5PNgBRuwsOhnw1Ni4uiO6wmQ5oIS4AvmlC93ERvybrCD5DoKw/qVn/w7UX4LO3m VpHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g4SkJgiG; 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 lk10-20020a17090b33ca00b001ed5b454a39si6532708pjb.139.2022.06.27.05.35.31; Mon, 27 Jun 2022 05:35:43 -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=g4SkJgiG; 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 S236007AbiF0LfI (ORCPT + 99 others); Mon, 27 Jun 2022 07:35:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236247AbiF0Lda (ORCPT ); Mon, 27 Jun 2022 07:33:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11355D119; Mon, 27 Jun 2022 04:30:43 -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 9046561355; Mon, 27 Jun 2022 11:30:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B93DC3411D; Mon, 27 Jun 2022 11:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1656329442; bh=NGrFpnGNy+UhulDZSNrnYduBOQTEXJrXmxA3Afg3+7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4SkJgiGRXXWGAe4hAKmoo0L8gkqfqVGqfy37QsQGJUojIGWhlaIGyP9eM5bmpeL5 9yHMPg0YjmWv9oEMoh7aBDTEZe942zgeH2r51IZcIUc/nFq6X7VTHH4BvBlyo1FKCE mWstepnwD1Ksodo9meXaAR3Wmyq0Q2DAEdLeDhqQ= 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.4 47/60] xtensa: Fix refcount leak bug in time.c Date: Mon, 27 Jun 2022 13:21:58 +0200 Message-Id: <20220627111929.073062554@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627111927.641837068@linuxfoundation.org> References: <20220627111927.641837068@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 @@ -160,6 +160,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;