From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D6F9CA0C3F; Wed, 7 Apr 2021 18:19:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7822E140F37; Wed, 7 Apr 2021 18:19:16 +0200 (CEST) Received: from sender11-of-o51.zoho.eu (sender11-of-o51.zoho.eu [31.186.226.237]) by mails.dpdk.org (Postfix) with ESMTP id EA254140F29 for ; Wed, 7 Apr 2021 18:19:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; t=1617812349; cv=none; d=zohomail.eu; s=zohoarc; b=EwgYZHOgUU+rzlhgQwrKveu6gNt2QK0BSWx919ApmfEv30gx9qL1CmUQva7d4W1CRfdYmTG1pqIpH2yaiFOBt6soQcaeaHNAUnS47re2u4txNaS79gOMJ+LbAo/29OqLGuGCIqapGwv4+6wt0z7PW7+isjCDCnnt/KCXT6JLNBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1617812349; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=SS0yGK2gEVHt+JtTAQ+y73O2PY1Q07JB/0QPQgbULjE=; b=N+sCSES+D1vD6p+dCSWaKPf7RTv6Wa2Dj7eSQNChMmcYNWH7IzCARdBY3yjeLu+gl6ArKYiiINDZ3LEvYoL9KUIc5D7iiVuV5DyHii7UCWyoyWQuxk79u+f3XGsJRN0Uesll8ivnS/lKnB0CZ1jAF8kss9QSWhapiFAyKehG0NQ= ARC-Authentication-Results: i=1; mx.zohomail.eu; spf=pass smtp.mailfrom=liangma@liangbit.com; dmarc=pass header.from= header.from= Received: from C02F33EJML85 (47.254.128.112 [47.254.128.112]) by mx.zoho.eu with SMTPS id 161781234740286.31765803418489; Wed, 7 Apr 2021 18:19:07 +0200 (CEST) Date: Wed, 7 Apr 2021 17:18:58 +0100 From: Liang Ma To: Anatoly Burakov Cc: dev@dpdk.org, david.hunt@intel.com, thomas@monjalon.net Message-ID: References: <20210407155642.435964-1-anatoly.burakov@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407155642.435964-1-anatoly.burakov@intel.com> X-ZohoMailClient: External Subject: Re: [dpdk-dev] [PATCH] power: fix use-after-free in pstate code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Reviewed-by: Liang Ma On Wed, Apr 07, 2021 at 03:56:42PM +0000, Anatoly Burakov wrote: > Previous fix has addressed the incorrect handling of `base_frequency` > file, but has added a use-after-free error due to the fact that all > further code paths will lead to an `fclose()` call at the end, so the > additional `fclose()` call right after processing the file was > unnecessary. > > Coverity issue: 369901 > > Fixes: 8a5febaac4f7 ("power: fix P-state base frequency handling") > > Signed-off-by: Anatoly Burakov > --- > lib/librte_power/power_pstate_cpufreq.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c > index 1cb0e4d917..ec745153d3 100644 > --- a/lib/librte_power/power_pstate_cpufreq.c > +++ b/lib/librte_power/power_pstate_cpufreq.c > @@ -220,7 +220,6 @@ power_init_for_setting_freq(struct pstate_power_info *pi) > > base_ratio = strtoul(buf_base, NULL, POWER_CONVERT_TO_DECIMAL) > / BUS_FREQ; > - fclose(f_base); > } > > /* Add MSR read to detect turbo status */ > -- > 2.25.1 >