Make pagedir_destroy(NULL) a no-op.
[pintos-anon] / src / userprog / pagedir.c
index bfcda457512574f85f06b1c950a08fe15117621a..1edd0ff1931f84888a922558fe73ac0f78365f95 100644 (file)
@@ -19,6 +19,9 @@ pagedir_destroy (uint32_t *pd)
 {
   uint32_t *pde;
 
+  if (pd == NULL)
+    return;
+
   for (pde = pd; pde < pd + pd_no (PHYS_BASE); pde++)
     if (*pde & PG_P) 
       {