diff options
| -rw-r--r-- | drivers/base/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index f9d31320bd37..519865b53f76 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
| @@ -290,7 +290,7 @@ int bus_for_each_dev(struct bus_type *bus, struct device *start, | |||
| 290 | struct device *dev; | 290 | struct device *dev; |
| 291 | int error = 0; | 291 | int error = 0; |
| 292 | 292 | ||
| 293 | if (!bus) | 293 | if (!bus || !bus->p) |
| 294 | return -EINVAL; | 294 | return -EINVAL; |
| 295 | 295 | ||
| 296 | klist_iter_init_node(&bus->p->klist_devices, &i, | 296 | klist_iter_init_node(&bus->p->klist_devices, &i, |
| @@ -324,7 +324,7 @@ struct device *bus_find_device(struct bus_type *bus, | |||
| 324 | struct klist_iter i; | 324 | struct klist_iter i; |
| 325 | struct device *dev; | 325 | struct device *dev; |
| 326 | 326 | ||
| 327 | if (!bus) | 327 | if (!bus || !bus->p) |
| 328 | return NULL; | 328 | return NULL; |
| 329 | 329 | ||
| 330 | klist_iter_init_node(&bus->p->klist_devices, &i, | 330 | klist_iter_init_node(&bus->p->klist_devices, &i, |
