diff options
-rw-r--r-- | drivers/base/power/domain.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index b0cf46dcae73..83ae3d7d3fdd 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1581,6 +1581,8 @@ int of_genpd_add_provider_onecell(struct device_node *np, mutex_lock(&gpd_list_lock); for (i = 0; i < data->num_domains; i++) { + if (!data->domains[i]) + continue; if (!pm_genpd_present(data->domains[i])) goto error; @@ -1598,6 +1600,8 @@ int of_genpd_add_provider_onecell(struct device_node *np, error: while (i--) { + if (!data->domains[i]) + continue; data->domains[i]->provider = NULL; data->domains[i]->has_provider = false; } |