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=7a1f43925b0780ac983c529f7ecba8d7437a9890;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) {