diff options
author | andreast <andreast@FreeBSD.org> | 2011-01-20 20:22:19 +0000 |
---|---|---|
committer | andreast <andreast@FreeBSD.org> | 2011-01-20 20:22:19 +0000 |
commit | ad366db2011f14e8f5f98e4ccdcb57ffd22f5c23 (patch) | |
tree | 1bc649a6a9120b09ca9537efad913192c55e6946 /sys/powerpc/powermac/uninorthpci.c | |
parent | 6d8a904d4902ca85ab4a35457d4844b3e2db8f7e (diff) | |
download | FreeBSD-src-ad366db2011f14e8f5f98e4ccdcb57ffd22f5c23.zip FreeBSD-src-ad366db2011f14e8f5f98e4ccdcb57ffd22f5c23.tar.gz |
Correct parsing of the grackle and uninorthpci ranges property.
Approved by: nwhitehorn (mentor)
Diffstat (limited to 'sys/powerpc/powermac/uninorthpci.c')
-rw-r--r-- | sys/powerpc/powermac/uninorthpci.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/powerpc/powermac/uninorthpci.c b/sys/powerpc/powermac/uninorthpci.c index cfc8862..421c7e5 100644 --- a/sys/powerpc/powermac/uninorthpci.c +++ b/sys/powerpc/powermac/uninorthpci.c @@ -231,11 +231,14 @@ uninorth_attach(device_t dev) return (ENXIO); } + sc->sc_nrange /= sizeof(sc->sc_range[0]); + sc->sc_range[6].pci_hi = 0; io = NULL; nmem = 0; - for (rp = sc->sc_range; rp->pci_hi != 0; rp++) { + for (rp = sc->sc_range; rp < sc->sc_range + sc->sc_nrange && + rp->pci_hi != 0; rp++) { switch (rp->pci_hi & OFW_PCI_PHYS_HI_SPACEMASK) { case OFW_PCI_PHYS_HI_SPACE_CONFIG: break; |