Fix double alloc in map_check
authorJack Miller <jack@codezen.org>
Wed, 6 Apr 2016 23:18:13 +0000 (18:18 -0500)
committerJack Miller <jack@codezen.org>
Wed, 6 Apr 2016 23:18:13 +0000 (18:18 -0500)
mm/map.c

index 82ec7ea..93375f0 100644 (file)
--- a/mm/map.c
+++ b/mm/map.c
@@ -52,7 +52,7 @@ static int __map_check(u64 * entry, u64 * target)
         if (phys == 0)
             return -ENOMEM;
 
-        *entry = (page_alloc_phys(0) | PF_RW | PF_P);
+        *entry = (phys | PF_RW | PF_P);
 
         /* reset_cr3 so the newly mapped page is accessible, zero it, then
          * reset cr3 again to make sure no crap mappings are in there. */