* [dpdk-dev] [PATCH] lib/power: fix return code to unsigned value
@ 2019-01-07 14:40 David Hunt
2019-01-14 22:55 ` Thomas Monjalon
0 siblings, 1 reply; 2+ messages in thread
From: David Hunt @ 2019-01-07 14:40 UTC (permalink / raw)
To: dev; +Cc: david.hunt, liang.j.ma
The power_pstate_cpufreq_freqs() function was returning -1 in an
unsigned int, causing buffer over-runs when the results were being
processed. This function should be returning zero for all error
conditions, similar to it's acpi relation, power_acpi_cpufreq_freqs().
Fixes: e6c6dc0f96c8 ("power: add p-state driver compatibility")
Signed-off-by: David Hunt <david.hunt@intel.com>
---
lib/librte_power/power_pstate_cpufreq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/librte_power/power_pstate_cpufreq.c b/lib/librte_power/power_pstate_cpufreq.c
index 0a566eb07..9ec5da511 100644
--- a/lib/librte_power/power_pstate_cpufreq.c
+++ b/lib/librte_power/power_pstate_cpufreq.c
@@ -577,7 +577,7 @@ power_pstate_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
if (lcore_id >= RTE_MAX_LCORE) {
RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
- return -1;
+ return 0;
}
if (freqs == NULL) {
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-01-14 22:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 14:40 [dpdk-dev] [PATCH] lib/power: fix return code to unsigned value David Hunt
2019-01-14 22:55 ` Thomas Monjalon
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).