diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psci/psci_main.c | 4 | ||||
-rw-r--r-- | lib/psci/psci_stat.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/psci/psci_main.c b/lib/psci/psci_main.c index d412be3c..3ad3dd40 100644 --- a/lib/psci/psci_main.c +++ b/lib/psci/psci_main.c @@ -97,6 +97,10 @@ int psci_cpu_suspend(unsigned int power_state, == PSCI_E_SUCCESS); target_pwrlvl = psci_find_target_suspend_lvl(&state_info); + if (target_pwrlvl == PSCI_INVALID_PWR_LVL) { + ERROR("Invalid target power level for suspend operation\n"); + panic(); + } /* Fast path for CPU standby.*/ if (is_cpu_standby_req(is_power_down_state, target_pwrlvl)) { diff --git a/lib/psci/psci_stat.c b/lib/psci/psci_stat.c index 155bbb07..ecbe592b 100644 --- a/lib/psci/psci_stat.c +++ b/lib/psci/psci_stat.c @@ -259,8 +259,10 @@ int psci_get_stat(u_register_t target_cpu, unsigned int power_state, /* Find the highest power level */ pwrlvl = psci_find_target_suspend_lvl(&state_info); - if (pwrlvl == PSCI_INVALID_PWR_LVL) - return PSCI_E_INVALID_PARAMS; + if (pwrlvl == PSCI_INVALID_PWR_LVL) { + ERROR("Invalid target power level for PSCI statistics operation\n"); + panic(); + } /* Get the index into the stats array */ local_state = state_info.pwr_domain_state[pwrlvl]; |