Skip to content

Commit e114c61

Browse files
krzkgregkh
authored andcommitted
PM / Domains: Fix unsafe iteration over modified list of domain providers
commit b556b15 upstream. 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) Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f422cfc commit e114c61

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
@@ -1642,10 +1642,10 @@ EXPORT_SYMBOL_GPL(__of_genpd_add_provider);
16421642
*/
16431643
void of_genpd_del_provider(struct device_node *np)
16441644
{
1645-
struct of_genpd_provider *cp;
1645+
struct of_genpd_provider *cp, *tmp;
16461646

16471647
mutex_lock(&of_genpd_mutex);
1648-
list_for_each_entry(cp, &of_genpd_providers, link) {
1648+
list_for_each_entry_safe(cp, tmp, &of_genpd_providers, link) {
16491649
if (cp->node == np) {
16501650
list_del(&cp->link);
16511651
of_node_put(cp->node);

0 commit comments

Comments
 (0)