Skip to content

Commit

Permalink
[SPARC64]: Check of_get_property() return in pci_determine_mem_io_spa…
Browse files Browse the repository at this point in the history
…ce().

If the PCI controller lacks the 'ranges' property nothing
is going to work.

Noticed by Al Viro.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 17, 2007
1 parent 719023f commit 4209ab0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/sparc64/kernel/pci_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,13 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)

saw_mem = saw_io = 0;
pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i);
if (!pbm_ranges) {
prom_printf("PCI: Fatal error, missing PBM ranges property "
" for %s\n",
pbm->name);
prom_halt();
}

num_pbm_ranges = i / sizeof(*pbm_ranges);

for (i = 0; i < num_pbm_ranges; i++) {
Expand Down

0 comments on commit 4209ab0

Please sign in to comment.