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 C2274A0562; Wed, 14 Apr 2021 12:00:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABF5A16192E; Wed, 14 Apr 2021 12:00:43 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 62BD116192D for ; Wed, 14 Apr 2021 12:00:42 +0200 (CEST) IronPort-SDR: HPEOz57QrXHSTFqr2p6ASk+2sfCF8CcbPDusVNRwTTrOEI45DfYipHF7KiVnGa43CvhxW79sfy SSTykoV288IA== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="174105808" X-IronPort-AV: E=Sophos;i="5.82,221,1613462400"; d="scan'208";a="174105808" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 03:00:41 -0700 IronPort-SDR: bb570n6Mgmu0VgcV84pKngoZrEpQ649WSam6pZ7ySoI1uBZjvswbuMWtXBF4Ct37Z2agdyLz// ECrEX5L7Qo8Q== X-IronPort-AV: E=Sophos;i="5.82,221,1613462400"; d="scan'208";a="600736528" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.213.237.43]) ([10.213.237.43]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2021 03:00:40 -0700 To: "Pattan, Reshma" , "dev@dpdk.org" Cc: "Hunt, David" References: <20210413122208.101057-1-anatoly.burakov@intel.com> From: "Burakov, Anatoly" Message-ID: <7d17e135-c121-ed19-1de6-00f372255a50@intel.com> Date: Wed, 14 Apr 2021 11:00:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] power: fix resource leak 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" On 14-Apr-21 10:24 AM, Pattan, Reshma wrote: > > >> -----Original Message----- >> From: Burakov, Anatoly >> base_max_ratio = >> strtoul(buf_base, NULL, >> POWER_CONVERT_TO_DECIMAL) >> / BUS_FREQ; >> +/* not needed any more */ >> +fclose(f_base_max); >> +f_base_max = NULL; > > Should this be moved before FOPS_OR_NULL_GOTO() call ? > No, otherwise we wouldn't be able to read the data. It *could* be moved to the end, but then we'd have to modify the rest of the logic as well, because right after this there are unconditional returns there. All of this is addressed in a refactor patch [1], this is just fixing a bug and nothing else. [1] http://patches.dpdk.org/project/dpdk/patch/20210402092701.258316-1-anatoly.burakov@intel.com/ -- Thanks, Anatoly