DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Hunt, David" <david.hunt@intel.com>
To: Liang Ma <liang.j.ma@intel.com>, dev@dpdk.org
Cc: anatoly.burakov@intel.com
Subject: Re: [dpdk-dev] [PATCH] power: fix coverity issue
Date: Mon, 8 Apr 2019 16:32:40 +0100	[thread overview]
Message-ID: <f6e8df28-658d-fb96-b3a1-e9a7cf36335b@intel.com> (raw)
In-Reply-To: <1554736884-12195-1-git-send-email-liang.j.ma@intel.com>

Hi Liang,

On 8/4/2019 4:21 PM, Liang Ma wrote:
> Coverity issue: 337668
>
> Fixes: b60fd5f8b1ce8f0a2c ("power: add bit for high frequency cores")
>
> Signed-off-by: Liang Ma <liang.j.ma@intel.com>
> ---
>   lib/librte_power/power_pstate_cpufreq.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c
> index 336c13869..db2f7a0f4 100644
> --- a/lib/librte_power/power_pstate_cpufreq.c
> +++ b/lib/librte_power/power_pstate_cpufreq.c
> @@ -197,6 +197,9 @@ power_init_for_setting_freq(struct pstate_power_info *pi)
>   				/ BUS_FREQ;
>   	}
>   
> +	if (f_base != NULL)
> +		fclose(f_base);
> +
>   	/* Add MSR read to detect turbo status */
>   
>   	if (power_rdmsr(PLATFORM_INFO, &max_non_turbo, pi->lcore_id) < 0)


Rather than adding a new 'if' statement, you could just add the fclose() 
to the previous section, which checks for a similar condition. Maybe 
just after the FOPS_OR_NULL_GOTO() (line 189).

Rgds,
Dave.

  parent reply	other threads:[~2019-04-08 15:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-08 15:21 Liang Ma
2019-04-08 15:21 ` Liang Ma
2019-04-08 15:32 ` Hunt, David [this message]
2019-04-08 15:32   ` Hunt, David
2019-04-08 16:19 ` [dpdk-dev] [PATCH v2] " Liang Ma
2019-04-08 16:19   ` Liang Ma
2019-05-03  9:26   ` Hunt, David
2019-05-03  9:26     ` Hunt, David
2019-05-09 18:46     ` Thomas Monjalon
2019-05-09 18:46       ` 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=f6e8df28-658d-fb96-b3a1-e9a7cf36335b@intel.com \
    --to=david.hunt@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=liang.j.ma@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).