diff options
-rw-r--r-- | mm/fadvise.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/fadvise.c b/mm/fadvise.c index 9b75a045dbf4..a83245763cf8 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c | |||
@@ -26,7 +26,8 @@ | |||
26 | */ | 26 | */ |
27 | SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) | 27 | SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) |
28 | { | 28 | { |
29 | struct file *file = fget(fd); | 29 | int fput_needed; |
30 | struct file *file = fget_light(fd, &fput_needed); | ||
30 | struct address_space *mapping; | 31 | struct address_space *mapping; |
31 | struct backing_dev_info *bdi; | 32 | struct backing_dev_info *bdi; |
32 | loff_t endbyte; /* inclusive */ | 33 | loff_t endbyte; /* inclusive */ |
@@ -128,7 +129,7 @@ SYSCALL_DEFINE(fadvise64_64)(int fd, loff_t offset, loff_t len, int advice) | |||
128 | ret = -EINVAL; | 129 | ret = -EINVAL; |
129 | } | 130 | } |
130 | out: | 131 | out: |
131 | fput(file); | 132 | fput_light(file, fput_needed); |
132 | return ret; | 133 | return ret; |
133 | } | 134 | } |
134 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS | 135 | #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS |