DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Pattan, Reshma" <reshma.pattan@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: "Hunt, David" <david.hunt@intel.com>
Subject: Re: [dpdk-dev] [PATCH] power: fix resource leak
Date: Wed, 14 Apr 2021 11:02:57 +0100	[thread overview]
Message-ID: <99b92f1e-01e3-91f4-8d40-8f5d8b26e018@intel.com> (raw)
In-Reply-To: <7d17e135-c121-ed19-1de6-00f372255a50@intel.com>

On 14-Apr-21 11:00 AM, Burakov, Anatoly wrote:
> On 14-Apr-21 10:24 AM, Pattan, Reshma wrote:
>>
>>
>>> -----Original Message-----
>>> From: Burakov, Anatoly <anatoly.burakov@intel.com>
>>>   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/ 
> 
> 

Actually, no, you're right! This does have to be moved till before 
FOPS_OR_NULL_GOTO, because this is where we actually read the data (if 
we fail to read data, we leak). I hate this code :D

-- 
Thanks,
Anatoly

  reply	other threads:[~2021-04-14 10:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 12:22 Anatoly Burakov
2021-04-14  9:24 ` Pattan, Reshma
2021-04-14 10:00   ` Burakov, Anatoly
2021-04-14 10:02     ` Burakov, Anatoly [this message]
2021-04-14 10:07 ` [dpdk-dev] [PATCH v2] " Anatoly Burakov
2021-04-14 10:16   ` Pattan, Reshma
2021-04-15 21:55     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=99b92f1e-01e3-91f4-8d40-8f5d8b26e018@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).