DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 1/1] power: fix potential null dereferences
@ 2021-07-09 15:01 Anatoly Burakov
  2021-07-09 15:09 ` David Marchand
  2021-07-09 15:55 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
  0 siblings, 2 replies; 5+ messages in thread
From: Anatoly Burakov @ 2021-07-09 15:01 UTC (permalink / raw)
  To: dev, David Hunt; +Cc: anatoly.burakov

Currently, the error paths can lead to attempts at dereferencing NULL
pointers. Add the check to avoid attempts at dereferencing NULL
pointers.

Fixes: 06cffd468fdd ("power: refactor ACPI and intel_pstate support")
Cc: anatoly.burakov@intel.com

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/power/power_pstate_cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c
index ba28ddcfca..3b607515fd 100644
--- a/lib/power/power_pstate_cpufreq.c
+++ b/lib/power/power_pstate_cpufreq.c
@@ -440,8 +440,10 @@ power_get_available_freqs(struct pstate_power_info *pi)
 			num_freqs, pi->lcore_id);
 
 out:
-	fclose(f_min);
-	fclose(f_max);
+	if (f_min != NULL)
+		fclose(f_min);
+	if (f_max != NULL)
+		fclose(f_max);
 
 	return ret;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/1] power: fix potential null dereferences
  2021-07-09 15:01 [dpdk-dev] [PATCH v1 1/1] power: fix potential null dereferences Anatoly Burakov
@ 2021-07-09 15:09 ` David Marchand
  2021-07-09 15:19   ` David Hunt
  2021-07-09 15:55 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
  1 sibling, 1 reply; 5+ messages in thread
From: David Marchand @ 2021-07-09 15:09 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, David Hunt

On Fri, Jul 9, 2021 at 5:02 PM Anatoly Burakov
<anatoly.burakov@intel.com> wrote:
>
> Currently, the error paths can lead to attempts at dereferencing NULL
> pointers. Add the check to avoid attempts at dereferencing NULL
> pointers.
>

Coverity issue: 371895

> Fixes: 06cffd468fdd ("power: refactor ACPI and intel_pstate support")
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/1] power: fix potential null dereferences
  2021-07-09 15:09 ` David Marchand
@ 2021-07-09 15:19   ` David Hunt
  0 siblings, 0 replies; 5+ messages in thread
From: David Hunt @ 2021-07-09 15:19 UTC (permalink / raw)
  To: David Marchand, Anatoly Burakov; +Cc: dev


On 9/7/2021 4:09 PM, David Marchand wrote:
> On Fri, Jul 9, 2021 at 5:02 PM Anatoly Burakov
> <anatoly.burakov@intel.com> wrote:
>> Currently, the error paths can lead to attempts at dereferencing NULL
>> pointers. Add the check to avoid attempts at dereferencing NULL
>> pointers.
>>
> Coverity issue: 371895


This patch also fixes

Coverity issue: 371889

Rgds,

Dave


>
>> Fixes: 06cffd468fdd ("power: refactor ACPI and intel_pstate support")
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dpdk-dev] [PATCH v2 1/1] power: fix potential null dereferences
  2021-07-09 15:01 [dpdk-dev] [PATCH v1 1/1] power: fix potential null dereferences Anatoly Burakov
  2021-07-09 15:09 ` David Marchand
@ 2021-07-09 15:55 ` Anatoly Burakov
  2021-07-20 15:21   ` David Marchand
  1 sibling, 1 reply; 5+ messages in thread
From: Anatoly Burakov @ 2021-07-09 15:55 UTC (permalink / raw)
  To: dev, David Hunt; +Cc: anatoly.burakov, David Marchand

Currently, the error paths can lead to attempts at dereferencing NULL
pointers. Add the check to avoid attempts at dereferencing NULL
pointers.

Coverity issue: 371895
Coverity issue: 371889
Fixes: 06cffd468fdd ("power: refactor ACPI and intel_pstate support")
Cc: anatoly.burakov@intel.com

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 lib/power/power_pstate_cpufreq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c
index ba28ddcfca..3b607515fd 100644
--- a/lib/power/power_pstate_cpufreq.c
+++ b/lib/power/power_pstate_cpufreq.c
@@ -440,8 +440,10 @@ power_get_available_freqs(struct pstate_power_info *pi)
 			num_freqs, pi->lcore_id);
 
 out:
-	fclose(f_min);
-	fclose(f_max);
+	if (f_min != NULL)
+		fclose(f_min);
+	if (f_max != NULL)
+		fclose(f_max);
 
 	return ret;
 }
-- 
2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dpdk-dev] [PATCH v2 1/1] power: fix potential null dereferences
  2021-07-09 15:55 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
@ 2021-07-20 15:21   ` David Marchand
  0 siblings, 0 replies; 5+ messages in thread
From: David Marchand @ 2021-07-20 15:21 UTC (permalink / raw)
  To: Anatoly Burakov; +Cc: dev, David Hunt

On Fri, Jul 9, 2021 at 5:57 PM Anatoly Burakov
<anatoly.burakov@intel.com> wrote:
>
> Currently, the error paths can lead to attempts at dereferencing NULL
> pointers. Add the check to avoid attempts at dereferencing NULL
> pointers.
>
> Coverity issue: 371895
> Coverity issue: 371889
> Fixes: 06cffd468fdd ("power: refactor ACPI and intel_pstate support")
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Reviewed-by: David Marchand <david.marchand@redhat.com>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-20 15:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 15:01 [dpdk-dev] [PATCH v1 1/1] power: fix potential null dereferences Anatoly Burakov
2021-07-09 15:09 ` David Marchand
2021-07-09 15:19   ` David Hunt
2021-07-09 15:55 ` [dpdk-dev] [PATCH v2 " Anatoly Burakov
2021-07-20 15:21   ` David Marchand

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).