Commit e10ce27f authored by Al Viro's avatar Al Viro

switch prctl_set_mm_exe_file() to fget_light()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 64e09fa2
...@@ -1790,9 +1790,9 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) ...@@ -1790,9 +1790,9 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
{ {
struct file *exe_file; struct file *exe_file;
struct dentry *dentry; struct dentry *dentry;
int err; int err, fput_needed;
exe_file = fget(fd); exe_file = fget_light(fd, &fput_needed);
if (!exe_file) if (!exe_file)
return -EBADF; return -EBADF;
...@@ -1839,12 +1839,12 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) ...@@ -1839,12 +1839,12 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
goto exit_unlock; goto exit_unlock;
err = 0; 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: exit_unlock:
up_write(&mm->mmap_sem); up_write(&mm->mmap_sem);
exit: exit:
fput(exe_file); fput_light(exe_file, fput_needed);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment