summaryrefslogtreecommitdiff
path: root/fs/exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 4f37deb79e00..3d9730f93e08 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -759,12 +759,6 @@ int flush_old_exec(struct linux_binprm * bprm)
char * name;
int i, ch, retval;
- /*
- * Release all of the old mmap stuff
- */
- retval = exec_mmap(bprm->mm);
- if (retval)
- goto out;
/*
* Make sure we have a private signal table and that
* we are unassociated from the previous thread group.
@@ -773,6 +767,13 @@ int flush_old_exec(struct linux_binprm * bprm)
if (retval)
goto out;
+ /*
+ * Release all of the old mmap stuff
+ */
+ retval = exec_mmap(bprm->mm);
+ if (retval)
+ goto out;
+
bprm->mm = NULL; /* We're using it now */
/* This is the point of no return */