aboutsummaryrefslogtreecommitdiffstats
path: root/f.patch
blob: 3ba51fe9322b1e5dce661003a22167fbee0a86cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
---
 drivers/base/core.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1142,6 +1142,9 @@ int device_for_each_child(struct device 
 	struct device *child;
 	int error = 0;
 
+	if (!parent->p)
+		return 0;
+
 	klist_iter_init(&parent->p->klist_children, &i);
 	while ((child = next_device(&i)) && !error)
 		error = fn(child, data);