summaryrefslogtreecommitdiffstats
path: root/kernel/kcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kcmp.c')
-rw-r--r--kernel/kcmp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/kcmp.c b/kernel/kcmp.c
index 5353edfad8..b0639f2104 100644
--- a/kernel/kcmp.c
+++ b/kernel/kcmp.c
@@ -64,8 +64,10 @@ get_file_raw_ptr(struct task_struct *task, unsigned int idx)
struct file *file;
rcu_read_lock();
- file = task_lookup_fd_rcu(task, idx);
+ file = task_lookup_fdget_rcu(task, idx);
rcu_read_unlock();
+ if (file)
+ fput(file);
return file;
}