Index: kernel/test/mm/mapping1.c
===================================================================
--- kernel/test/mm/mapping1.c	(revision b860f9eb606522b9cb2bf90c977ddf9a913253f7)
+++ kernel/test/mm/mapping1.c	(revision a1d7b4b64d80fd99178eff41903b8d4810473657)
@@ -66,6 +66,10 @@
 		v = *((uint32_t *) page1);
 	
-		if (v != TEST_MAGIC)
+		if (v != TEST_MAGIC) {
+			km_unmap(page0, PAGE_SIZE);
+			km_unmap(page1, PAGE_SIZE);
+			frame_free(frame);
 			return "Criss-cross read does not match the value written.";
+		}
 
 		TPRINTF("Writing zero using the second virtual address.\n");
@@ -77,6 +81,10 @@
 		v = *((uint32_t *) page0);
 	
-		if (v != 0)
+		if (v != 0) {
+			km_unmap(page0, PAGE_SIZE);
+			km_unmap(page1, PAGE_SIZE);
+			frame_free(frame);
 			return "Criss-cross read does not match the value written.";
+		}
 	}
 
