Skip to contentSkip to conversation

Patch "PM / Domains: Fix unsafe iteration over modified list of domain providers" has been added to the 3.18-stable tree

PATCH [email protected] 1 participant 1 message Jul 22, 2017

Subsystems (5)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

PM / Domains: Fix unsafe iteration over modified list of domain providers

to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
pm-domains-fix-unsafe-iteration-over-modified-list-of-domain-providers.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From b556b15dc04e9b9b98790f04c21acf5e24f994b2 Mon Sep 17 00:00:00 2001

From: Krzysztof Kozlowski <[email protected]>
Date: Wed, 28 Jun 2017 16:56:19 +0200
Subject: PM / Domains: Fix unsafe iteration over modified list of domain providers

From: Krzysztof Kozlowski <[email protected]>

commit b556b15dc04e9b9b98790f04c21acf5e24f994b2 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 aa42240ab254 (PM / Domains: Add generic OF-based PM domain look-up)
---
 drivers/base/power/domain.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/power/domain.c +2 -2
@@ -2056,10 +2056,10 @@ EXPORT_SYMBOL_GPL(__of_genpd_add_provide
  */
 void of_genpd_del_provider(struct device_node *np)
 {
-	struct of_genpd_provider *cp;
+	struct of_genpd_provider *cp, *tmp;
 
 	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) {
 			list_del(&cp->link);
 			of_node_put(cp->node);

Patches currently in stable-queue which might be from [email protected] are

queue-3.18/pm-domains-fix-unsafe-iteration-over-modified-list-of-domain-providers.patch queue-3.18/pm-domains-fix-unsafe-iteration-over-modified-list-of-device-links.patch