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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5D77C43460 for ; Wed, 14 Apr 2021 10:00:44 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 4919D6113D for ; Wed, 14 Apr 2021 10:00:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4919D6113D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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