diff options
| author | Len Brown <len.brown@intel.com> | 2004-12-20 02:40:03 -0500 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2004-12-20 02:40:03 -0500 |
| commit | d5d4cbf800d2def1dc937afdf510b968e5beb0c0 (patch) | |
| tree | 0045ebeede42a289892e8a8bb4e85c44c029b197 /fs/exec.c | |
| parent | a3c76a77886d824ee896b1548104552bbb47e7e5 (diff) | |
| parent | 6484567f9f24417999208f2fbb018be555b1d810 (diff) | |
Merge intel.com:/home/lenb/bk/26-latest-ref
into intel.com:/home/lenb/src/26-latest-dev
Diffstat (limited to 'fs/exec.c')
| -rw-r--r-- | fs/exec.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/exec.c b/fs/exec.c index dd1c43b6f975..a2e554cdace3 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -1094,26 +1094,26 @@ int do_execve(char * filename, int retval; int i; - file = open_exec(filename); - - retval = PTR_ERR(file); - if (IS_ERR(file)) - return retval; - - sched_exec(); - retval = -ENOMEM; bprm = kmalloc(sizeof(*bprm), GFP_KERNEL); if (!bprm) goto out_ret; memset(bprm, 0, sizeof(*bprm)); + file = open_exec(filename); + retval = PTR_ERR(file); + if (IS_ERR(file)) + goto out_kfree; + + sched_exec(); + bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); bprm->file = file; bprm->filename = filename; bprm->interp = filename; bprm->mm = mm_alloc(); + retval = -ENOMEM; if (!bprm->mm) goto out_file; @@ -1180,6 +1180,8 @@ out_file: allow_write_access(bprm->file); fput(bprm->file); } + +out_kfree: kfree(bprm); out_ret: |
