Previously the vm_power_manager app required to have some vms defined, so
the call to get_all_vm() always set the noVms variable. Now we're accepting
policies from the host OS (without any VMs defined), so it is now valid to
have zero VMs. This patch initialises the relevant variables to zero just
in case the call to get_all_vms() does not find any, so could return with
the variables uninitialised.

Signed-off-by: David Hunt <david.h...@intel.com>
Acked-by: Anatoly Burakov <anatoly.bura...@intel.com>
---
 examples/vm_power_manager/channel_monitor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/vm_power_manager/channel_monitor.c 
b/examples/vm_power_manager/channel_monitor.c
index 7fa47ba97..f180d74e6 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -66,7 +66,7 @@ static void
 core_share_status(int pNo)
 {
 
-       int noVms, noVcpus, z, x, t;
+       int noVms = 0, noVcpus = 0, z, x, t;
 
        get_all_vm(&noVms, &noVcpus);
 
-- 
2.17.1

Reply via email to