diff options
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r-- | drivers/base/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index e73c92d13a23..d230ff4b3eec 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -1142,6 +1142,9 @@ int device_for_each_child(struct device *parent, void *data, | |||
1142 | struct device *child; | 1142 | struct device *child; |
1143 | int error = 0; | 1143 | int error = 0; |
1144 | 1144 | ||
1145 | if (!parent->p) | ||
1146 | return 0; | ||
1147 | |||
1145 | klist_iter_init(&parent->p->klist_children, &i); | 1148 | klist_iter_init(&parent->p->klist_children, &i); |
1146 | while ((child = next_device(&i)) && !error) | 1149 | while ((child = next_device(&i)) && !error) |
1147 | error = fn(child, data); | 1150 | error = fn(child, data); |