]> err.no Git - linux-2.6/commitdiff
[SPARC64]: Check of_get_property() return in pci_determine_mem_io_space().
authorDavid S. Miller <davem@sunset.davemloft.net>
Tue, 16 Oct 2007 03:45:32 +0000 (20:45 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 17 Oct 2007 23:25:10 +0000 (16:25 -0700)
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>
arch/sparc64/kernel/pci_common.c

index c76bfbb7da085cd5538391713c13e9b86f9ed148..923e0bcc3bfdb0e65cdb6b957324957aa886040a 100644 (file)
@@ -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++) {