From 7a1f43925b0780ac983c529f7ecba8d7437a9890 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 20 Sep 2004 22:25:28 +0000 Subject: [PATCH] Make pagedir_destroy(NULL) a no-op. --- src/userprog/pagedir.c | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.30.2