diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index f6e8fb9b1..9a725e9c8 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -369,8 +369,11 @@ static inline void close_files(struct files_struct * files) break; while (set) { if (set & 1) { - close_fp(files->fd[i]); - files->fd[i] = NULL; + struct file * file = files->fd[i]; + if (file) { + files->fd[i] = NULL; + close_fp(file); + } } i++; set >>= 1; @@ -405,8 +408,8 @@ static inline void __exit_fs(struct task_struct *tsk) if (fs) { tsk->fs = NULL; if (!--fs->count) { - iput(fs->root); - iput(fs->pwd); + dput(fs->root); + dput(fs->pwd); kfree(fs); } } |