Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1424707 > unrolled thread

[PATCH v2 06/10] driver core: Avoid endless recursion if device has more than one link

Started byMarek Szyprowski <m.szyprowski@samsung.com>
First post2016-06-17 08:30 +0200
Last post2016-06-17 08:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 06/10] driver core: Avoid endless recursion if device has  more than one link Marek Szyprowski <m.szyprowski@samsung.com> - 2016-06-17 08:30 +0200

#1424707 — [PATCH v2 06/10] driver core: Avoid endless recursion if device has more than one link

FromMarek Szyprowski <m.szyprowski@samsung.com>
Date2016-06-17 08:30 +0200
Subject[PATCH v2 06/10] driver core: Avoid endless recursion if device has more than one link
Message-ID<rKVrY-2WT-15@gated-at.bofh.it>
This patch fixes endless recursion, which happends when device has
more than one link.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/base/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 215cd44de761..4e778539b750 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -57,7 +57,8 @@ static int device_reorder_to_tail(struct device *dev, void *not_used)
 	device_pm_move_last(dev);
 	device_for_each_child(dev, NULL, device_reorder_to_tail);
 	list_for_each_entry(link, &dev->consumer_links, c_node)
-		device_reorder_to_tail(link->consumer, NULL);
+		if (link->consumer != dev)
+			device_reorder_to_tail(link->consumer, NULL);
 
 	return 0;
 }
-- 
1.9.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web