diff --git a/servers/vm/mem_anon.c b/servers/vm/mem_anon.c index 0971708fd..55d30bc23 100644 --- a/servers/vm/mem_anon.c +++ b/servers/vm/mem_anon.c @@ -108,9 +108,11 @@ static int anon_sanitycheck(struct phys_region *pr, char *file, int line) static int anon_writable(struct phys_region *pr) { assert(pr->ph->refcount > 0); + if(pr->ph->phys == MAP_NONE) + return 0; if(pr->parent->remaps > 0) return 1; - return pr->ph->phys != MAP_NONE && pr->ph->refcount == 1; + return pr->ph->refcount == 1; } static int anon_resize(struct vmproc *vmp, struct vir_region *vr, vir_bytes l) diff --git a/servers/vm/region.c b/servers/vm/region.c index 8d55fe3ae..78ad03f31 100644 --- a/servers/vm/region.c +++ b/servers/vm/region.c @@ -1032,9 +1032,11 @@ int write; assert(ph); assert(ph->ph); + assert(ph->ph->phys != MAP_NONE); } assert(ph->ph); + assert(ph->ph->phys != MAP_NONE); if((r = map_ph_writept(vmp, region, ph)) != OK) { printf("map_pf: writept failed\n");