Skip to contentSkip to conversation

power: fix frequency list buffer validation

PATCH In review Kevin Traynor 2 participants 2 messages Feb 6, 2019 – Mar 29, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: fix frequency list buffer validation

The frequency list buffer was already validated in power_acpi_cpufreq_freqs(), so the newly added check was redundant. To keep consistency with power_pstate_cpufreq_freqs(), remove the original check and update the log message.

Fixes 2e6ccdb4e088 ("power: fix frequency list to handle null buffer")
---
 lib/librte_power/power_acpi_cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_power/power_acpi_cpufreq.c +2 -2
index 45412f0b9..534efe817 100644
@@ -441,6 +441,6 @@ power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)
 	struct rte_power_info *pi;
 
-	if (lcore_id >= RTE_MAX_LCORE || !freqs) {
-		RTE_LOG(ERR, POWER, "Invalid input parameter\n");
+	if (lcore_id >= RTE_MAX_LCORE) {
+		RTE_LOG(ERR, POWER, "Invalid lcore ID\n");
 		return 0;
 	}
Signature · 1 line
2.19.0
#1 lore raw

06/02/2019 13:19, Kevin Traynor:

Quoted 9 lines

The frequency list buffer was already validated in power_acpi_cpufreq_freqs(), so the newly added check was redundant. To keep consistency with power_pstate_cpufreq_freqs(), remove the original check and update the log message.

Fixes 2e6ccdb4e088 ("power: fix frequency list to handle null buffer")

In absence of review, applied, thanks.