--- fork.c.~1~ Mon Apr 7 23:30:25 1997
+++ fork.c Wed Apr 9 18:11:48 1997
@@ -129,16 +129,20 @@
tsk->cmin_flt = tsk->cmaj_flt = 0;
tsk->nswap = tsk->cnswap = 0;
if (new_page_tables(tsk))
- return -1;
- if (dup_mmap(mm)) {
- free_page_tables(mm);
- return -1;
- }
+ goto npt_fail;
+ if (dup_mmap(mm))
+ goto dupmmap_fail;
return 0;
}
SET_PAGE_DIR(tsk, current->mm->pgd);
current->mm->count++;
return 0;
+
+dupmmap_fail:
+ free_page_tables(mm);
+npt_fail:
+ kfree(mm);
+ return -1;
}
static inline int copy_fs(unsigned long clone_flags, struct task_struct * tsk)