From ad514edf71fbd54c3ef0a8a1b3e112a8f52f53c9 Mon Sep 17 00:00:00 2001 From: David Hunt Date: Mon, 7 Jan 2019 14:40:23 +0000 Subject: [PATCH] power: fix frequency list return code 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 --- 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 9111e6a577..c4d972fc03 100644 --- a/lib/librte_power/power_pstate_cpufreq.c +++ b/lib/librte_power/power_pstate_cpufreq.c @@ -581,7 +581,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.20.1