diff options
Diffstat (limited to 'drivers/bcma/scan.c')
-rw-r--r-- | drivers/bcma/scan.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index cad994857683..3a2f672db9ad 100644 --- a/drivers/bcma/scan.c +++ b/drivers/bcma/scan.c | |||
@@ -399,15 +399,18 @@ int bcma_bus_scan(struct bcma_bus *bus) | |||
399 | core->bus = bus; | 399 | core->bus = bus; |
400 | 400 | ||
401 | err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core); | 401 | err = bcma_get_next_core(bus, &eromptr, NULL, core_num, core); |
402 | if (err == -ENODEV) { | 402 | if (err < 0) { |
403 | core_num++; | 403 | kfree(core); |
404 | continue; | 404 | if (err == -ENODEV) { |
405 | } else if (err == -ENXIO) | 405 | core_num++; |
406 | continue; | 406 | continue; |
407 | else if (err == -ESPIPE) | 407 | } else if (err == -ENXIO) { |
408 | break; | 408 | continue; |
409 | else if (err < 0) | 409 | } else if (err == -ESPIPE) { |
410 | break; | ||
411 | } | ||
410 | return err; | 412 | return err; |
413 | } | ||
411 | 414 | ||
412 | core->core_index = core_num++; | 415 | core->core_index = core_num++; |
413 | bus->nr_cores++; | 416 | bus->nr_cores++; |