From 446c57926d35006b63b1679564b302a463677e06 Mon Sep 17 00:00:00 2001 From: dillon Date: Thu, 7 Mar 2002 03:54:56 +0000 Subject: Fix a bug in the vm_map_clean() procedure. msync()ing an area of memory that has just been mapped MAP_ANON|MAP_NOSYNC and has not yet been accessed will panic the machine. MFC after: 1 day --- sys/vm/vm_map.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/vm/vm_map.c') diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 8b7a230..7a2cd70 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -1882,8 +1882,11 @@ vm_map_clean( * to write out. * We invalidate (remove) all pages from the address space * anyway, for semantic correctness. + * + * note: certain anonymous maps, such as MAP_NOSYNC maps, + * may start out with a NULL object. */ - while (object->backing_object) { + while (object && object->backing_object) { object = object->backing_object; offset += object->backing_object_offset; if (object->size < OFF_TO_IDX( offset + size)) -- cgit v1.1