diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index 4a103c6de9..5cb8339536 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -511,7 +511,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf) } } - if ( perf->flags & XEN_PX_PSS ) + if ( perf->flags & XEN_PX_PSS && !pxpt->states ) { /* capability check */ if ( perf->state_count <= 1 ) @@ -528,6 +528,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *perf) } if ( copy_from_guest(pxpt->states, perf->states, perf->state_count) ) { + XFREE(pxpt->states); ret = -EFAULT; goto out; }