diff --git a/drivers/cpuidle/governors/qcom-cluster-lpm.c b/drivers/cpuidle/governors/qcom-cluster-lpm.c index 54be4cec2cde..52631eff9244 100644 --- a/drivers/cpuidle/governors/qcom-cluster-lpm.c +++ b/drivers/cpuidle/governors/qcom-cluster-lpm.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2021, The Linux Foundation. All rights reserved. - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -305,6 +305,9 @@ static int cluster_power_cb(struct notifier_block *nb, cluster_predict(cluster_gov); break; case GENPD_NOTIFY_PRE_OFF: + if (!pd->gd) + return NOTIFY_BAD; + if (!cluster_gov->state_allowed[pd->state_idx]) return NOTIFY_BAD;