Skip to content

Commit

Permalink
switch prctl_set_mm_exe_file() to fget_light()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 64e09fa commit e10ce27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1790,9 +1790,9 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
{
struct file *exe_file;
struct dentry *dentry;
int err;
int err, fput_needed;

exe_file = fget(fd);
exe_file = fget_light(fd, &fput_needed);
if (!exe_file)
return -EBADF;

Expand Down Expand Up @@ -1839,12 +1839,12 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
goto exit_unlock;

err = 0;
set_mm_exe_file(mm, exe_file);
set_mm_exe_file(mm, exe_file); /* this grabs a reference to exe_file */
exit_unlock:
up_write(&mm->mmap_sem);

exit:
fput(exe_file);
fput_light(exe_file, fput_needed);
return err;
}

Expand Down

0 comments on commit e10ce27

Please sign in to comment.