summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-27 19:02:21 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-27 03:10:12 +0200
commite10ce27f0df9eda7b36eb16e553f07a9e05c6bba (patch)
treeac0065c4a830ad74e0999c4455c32202815fed9b
parentswitch xfs_find_handle() to fget_light() (diff)
downloadlinux-e10ce27f0df9eda7b36eb16e553f07a9e05c6bba.tar.xz
linux-e10ce27f0df9eda7b36eb16e553f07a9e05c6bba.zip
switch prctl_set_mm_exe_file() to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--kernel/sys.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 241507f23eca..0cb4283df884 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -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;
@@ -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;
}