# Pastebin pumX361G diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c index ea7d753a38ef..7f559071e8d5 100644 --- a/drivers/clk/qcom/gdsc.c +++ b/drivers/clk/qcom/gdsc.c @@ -542,24 +542,30 @@ void gdsc_unregister(struct gdsc_desc *desc) pm_genpd_remove_subdomain(scs[i]->parent, &scs[i]->pd); else if (!IS_ERR_OR_NULL(dev->pm_domain)) pm_genpd_remove_subdomain(pd_to_genpd(dev->pm_domain), &scs[i]->pd); } of_genpd_del_provider(dev->of_node); } void gdsc_sync_state(struct device *dev) { struct gdsc_desc *scd = qcom_cc_get_gdsc_desc(dev); - struct gdsc **scs = scd->scs; - size_t num = scd->num; + struct gdsc **scs; + size_t num; int i; + if (!scd) + return; + + scs = scd->scs; + num = scd->num; + for (i = 0; i < num; i++) { if (!scs[i]) continue; scs[i]->state_synced = true; pm_genpd_queue_power_off(&scs[i]->pd); } } /*