diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-27 13:02:21 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:10:12 -0400 |
commit | e10ce27f0df9eda7b36eb16e553f07a9e05c6bba (patch) | |
tree | ac0065c4a830ad74e0999c4455c32202815fed9b /kernel/sys.c | |
parent | 64e09fa2e1fef1696a8685c7aad7e0d3dd24ce71 (diff) |
switch prctl_set_mm_exe_file() to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 8 |
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) | |||
1790 | { | 1790 | { |
1791 | struct file *exe_file; | 1791 | struct file *exe_file; |
1792 | struct dentry *dentry; | 1792 | struct dentry *dentry; |
1793 | int err; | 1793 | int err, fput_needed; |
1794 | 1794 | ||
1795 | exe_file = fget(fd); | 1795 | exe_file = fget_light(fd, &fput_needed); |
1796 | if (!exe_file) | 1796 | if (!exe_file) |
1797 | return -EBADF; | 1797 | return -EBADF; |
1798 | 1798 | ||
@@ -1839,12 +1839,12 @@ static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd) | |||
1839 | goto exit_unlock; | 1839 | goto exit_unlock; |
1840 | 1840 | ||
1841 | err = 0; | 1841 | err = 0; |
1842 | set_mm_exe_file(mm, exe_file); | 1842 | set_mm_exe_file(mm, exe_file); /* this grabs a reference to exe_file */ |
1843 | exit_unlock: | 1843 | exit_unlock: |
1844 | up_write(&mm->mmap_sem); | 1844 | up_write(&mm->mmap_sem); |
1845 | 1845 | ||
1846 | exit: | 1846 | exit: |
1847 | fput(exe_file); | 1847 | fput_light(exe_file, fput_needed); |
1848 | return err; | 1848 | return err; |
1849 | } | 1849 | } |
1850 | 1850 | ||