diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-09-08 16:58:06 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2010-09-08 16:58:06 +0000 |
commit | e956a1ec841f76873b0d4264392a95705f127888 (patch) | |
tree | ac9b8b05887a21f7aa457d0b32daed65ec480afc /sys/powerpc/aim/mmu_oea.c | |
parent | 26d5f66d9476f898f33a6e749020ccc9f24e12bc (diff) | |
download | FreeBSD-src-e956a1ec841f76873b0d4264392a95705f127888.zip FreeBSD-src-e956a1ec841f76873b0d4264392a95705f127888.tar.gz |
Fix a typo in the original import of this code from NetBSD that caused the
wrong element of the VSID bitmap array to be examined after a collision,
leading to reallocation of in-use VSIDs under some circumstances, with
attendant memory corruption. Also add an assert to check for this kind of
problem in the future.
MFC after: 4 days
Diffstat (limited to 'sys/powerpc/aim/mmu_oea.c')
-rw-r--r-- | sys/powerpc/aim/mmu_oea.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index d3a2459..2ade00f 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -1618,7 +1618,7 @@ moea_pinit(mmu_t mmu, pmap_t pmap) entropy = (moea_vsidcontext >> 20); continue; } - i = ffs(~moea_vsid_bitmap[i]) - 1; + i = ffs(~moea_vsid_bitmap[n]) - 1; mask = 1 << i; hash &= 0xfffff & ~(VSID_NBPW - 1); hash |= i; |