|
@@ -290,7 +290,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start,
|
|
struct device *dev;
|
|
struct device *dev;
|
|
int error = 0;
|
|
int error = 0;
|
|
|
|
|
|
- if (!bus)
|
|
|
|
|
|
+ if (!bus || !bus->p)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
klist_iter_init_node(&bus->p->klist_devices, &i,
|
|
klist_iter_init_node(&bus->p->klist_devices, &i,
|
|
@@ -324,7 +324,7 @@ struct device *bus_find_device(struct bus_type *bus,
|
|
struct klist_iter i;
|
|
struct klist_iter i;
|
|
struct device *dev;
|
|
struct device *dev;
|
|
|
|
|
|
- if (!bus)
|
|
|
|
|
|
+ if (!bus || !bus->p)
|
|
return NULL;
|
|
return NULL;
|
|
|
|
|
|
klist_iter_init_node(&bus->p->klist_devices, &i,
|
|
klist_iter_init_node(&bus->p->klist_devices, &i,
|