From: Krzysztof Kozlowski Date: Wed, 28 Jun 2017 14:56:19 +0000 (+0200) Subject: PM / Domains: Fix unsafe iteration over modified list of domain providers X-Git-Tag: v4.14-rc1~417^2^3~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b556b15dc04e9b9b98790f04c21acf5e24f994b2;p=platform%2Fkernel%2Flinux-rpi.git PM / Domains: Fix unsafe iteration over modified list of domain providers of_genpd_del_provider() iterates over list of domain provides and removes matching element thus it has to use safe version of list iteration. Fixes: aa42240ab254 (PM / Domains: Add generic OF-based PM domain look-up) Cc: 3.19+ # 3.19+ Signed-off-by: Krzysztof Kozlowski Acked-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 048dc74..0b836fd 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1835,12 +1835,12 @@ EXPORT_SYMBOL_GPL(of_genpd_add_provider_onecell); */ void of_genpd_del_provider(struct device_node *np) { - struct of_genpd_provider *cp; + struct of_genpd_provider *cp, *tmp; struct generic_pm_domain *gpd; mutex_lock(&gpd_list_lock); mutex_lock(&of_genpd_mutex); - list_for_each_entry(cp, &of_genpd_providers, link) { + list_for_each_entry_safe(cp, tmp, &of_genpd_providers, link) { if (cp->node == np) { /* * For each PM domain associated with the