Skip to content

Commit b556b15

Browse files
krzkrafaeljw
authored andcommitted
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: aa42240 (PM / Domains: Add generic OF-based PM domain look-up) Cc: 3.19+ <[email protected]> # 3.19+ Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent c6e83ca commit b556b15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/base/power/domain.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,12 +1835,12 @@ EXPORT_SYMBOL_GPL(of_genpd_add_provider_onecell);
18351835
*/
18361836
void of_genpd_del_provider(struct device_node *np)
18371837
{
1838-
struct of_genpd_provider *cp;
1838+
struct of_genpd_provider *cp, *tmp;
18391839
struct generic_pm_domain *gpd;
18401840

18411841
mutex_lock(&gpd_list_lock);
18421842
mutex_lock(&of_genpd_mutex);
1843-
list_for_each_entry(cp, &of_genpd_providers, link) {
1843+
list_for_each_entry_safe(cp, tmp, &of_genpd_providers, link) {
18441844
if (cp->node == np) {
18451845
/*
18461846
* For each PM domain associated with the

0 commit comments

Comments
 (0)