From: Ben Pfaff Date: Mon, 20 Sep 2004 22:25:28 +0000 (+0000) Subject: Make pagedir_destroy(NULL) a no-op. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9d2f441f65d0c3a92938df02a752e6c78de487d;p=pintos-anon Make pagedir_destroy(NULL) a no-op. --- diff --git a/src/userprog/pagedir.c b/src/userprog/pagedir.c index bfcda45..1edd0ff 100644 --- a/src/userprog/pagedir.c +++ b/src/userprog/pagedir.c @@ -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) {