Index: lib/libc/sys/shm_open.c =================================================================== --- lib/libc/sys/shm_open.c +++ lib/libc/sys/shm_open.c @@ -65,7 +65,7 @@ int error, fd, saved_errno; fd = __sys_shm_open2(path, flags | O_CREAT, mode, SHM_LARGEPAGE, NULL); - if (error == -1) + if (fd == -1) return (-1); memset(&slc, 0, sizeof(slc)); Index: sys/amd64/amd64/pmap.c =================================================================== --- sys/amd64/amd64/pmap.c +++ sys/amd64/amd64/pmap.c @@ -6533,14 +6533,14 @@ mp->ref_count++; } KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 && - (origpte & PG_FRAME) == (newpte & PG_FRAME)), - ("va %#lx changing 1G phys page pdpe %#lx newpte %#lx", - va, origpte, newpte)); - if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0) + (origpte & PG_FRAME) == (pten & PG_FRAME)), + ("va %#lx changing 1G phys page pdpe %#lx pten %#lx", + va, origpte, pten)); + if ((pten & PG_W) != 0 && (origpte & PG_W) == 0) pmap->pm_stats.wired_count += NBPDP / PAGE_SIZE; - else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0) + else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0) pmap->pm_stats.wired_count -= NBPDP / PAGE_SIZE; - *pdpe = newpte; + *pdpe = pten; } else /* (psind == 1) */ { /* 2M */ if (!pmap_pkru_same(pmap, va, va + NBPDR)) return (KERN_PROTECTION_FAILURE); @@ -6569,14 +6569,14 @@ mp->ref_count++; } KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 && - (origpte & PG_FRAME) == (newpte & PG_FRAME)), - ("va %#lx changing 2M phys page pde %#lx newpte %#lx", - va, origpte, newpte)); - if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0) + (origpte & PG_FRAME) == (pten & PG_FRAME)), + ("va %#lx changing 2M phys page pde %#lx pten %#lx", + va, origpte, pten)); + if ((pten & PG_W) != 0 && (origpte & PG_W) == 0) pmap->pm_stats.wired_count += NBPDR / PAGE_SIZE; - else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0) + else if ((pten & PG_W) == 0 && (origpte & PG_W) != 0) pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; - *pde = newpte; + *pde = pten; } if ((origpte & PG_V) == 0) pmap_resident_count_inc(pmap, pagesizes[psind] / PAGE_SIZE);