diff --git a/nvm/machine_libipmctl.go b/nvm/machine_libipmctl.go index 2eb717b600..1b02faa895 100644 --- a/nvm/machine_libipmctl.go +++ b/nvm/machine_libipmctl.go @@ -57,6 +57,11 @@ func getAvgPowerBudget() (uint, error) { return uint(0), fmt.Errorf("Unable to get number of NVM devices. Status code: %d", err) } + if count == 0 { + klog.Warningf("There are no NVM devices!") + return uint(0), nil + } + // Load basic device information for all the devices // to obtain UID of the first one. devices := make([]C.struct_device_discovery, count)