patch-2.3.4 linux/fs/exec.c

Next file: linux/fs/isofs/inode.c
Previous file: linux/fs/efs/super.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/fs/exec.c linux/fs/exec.c
@@ -415,12 +415,11 @@
 	 * Failure ... restore the prior mm_struct.
 	 */
 fail_restore:
-	/* The pgd belongs to the parent ... don't free it! */
-	mm->pgd = NULL;
 	current->mm = old_mm;
 	/* restore the ldt for this task */
 	copy_segments(nr, current, NULL);
-	mmput(mm);
+	release_segments(mm);
+	kmem_cache_free(mm_cachep, mm);
 
 fail_nomem:
 	return retval;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)