diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-10-15 23:45:32 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-17 19:25:10 -0400 |
commit | 4209ab098c61b1a9684bb4d3fc287352fc2438c3 (patch) | |
tree | 5f8862485df17c6ab87cb8396280f14ab03a3e9b | |
parent | 719023fb90009855c4515a16349fc6d0a2f93a74 (diff) |
[SPARC64]: Check of_get_property() return in pci_determine_mem_io_space().
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>
-rw-r--r-- | arch/sparc64/kernel/pci_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index c76bfbb7da08..923e0bcc3bfd 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c | |||
@@ -396,6 +396,13 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm) | |||
396 | 396 | ||
397 | saw_mem = saw_io = 0; | 397 | saw_mem = saw_io = 0; |
398 | pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i); | 398 | pbm_ranges = of_get_property(pbm->prom_node, "ranges", &i); |
399 | if (!pbm_ranges) { | ||
400 | prom_printf("PCI: Fatal error, missing PBM ranges property " | ||
401 | " for %s\n", | ||
402 | pbm->name); | ||
403 | prom_halt(); | ||
404 | } | ||
405 | |||
399 | num_pbm_ranges = i / sizeof(*pbm_ranges); | 406 | num_pbm_ranges = i / sizeof(*pbm_ranges); |
400 | 407 | ||
401 | for (i = 0; i < num_pbm_ranges; i++) { | 408 | for (i = 0; i < num_pbm_ranges; i++) { |