This patch fixes a segfault in the case where a null buffer is passed
to the following functions:
power_acpi_cpufreq_freqs()
power_pstate_cpufreq_freqs()
Fixes:
445c6528b55f ("power: common interface for guest and host")
Signed-off-by: David Hunt <david.hunt@intel.com>
return 0;
}
+ if (freqs == NULL) {
+ RTE_LOG(ERR, POWER, "NULL buffer supplied\n");
+ return 0;
+ }
+
pi = &lcore_power_info[lcore_id];
if (num < pi->nb_freqs) {
RTE_LOG(ERR, POWER, "Buffer size is not enough\n");
return -1;
}
+ if (freqs == NULL) {
+ RTE_LOG(ERR, POWER, "NULL buffer supplied\n");
+ return 0;
+ }
+
pi = &lcore_power_info[lcore_id];
if (num < pi->nb_freqs) {
RTE_LOG(ERR, POWER, "Buffer size is not enough\n");