summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-07-20 14:56:40 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-07-20 14:56:40 +0000
commite308faf24f68e262d92d294a01ddca7a17e76762 (patch)
tree22c47cb315811834861f013067878ff664e95abd /kernel/exit.c
parent30c6397ce63178fcb3e7963ac247f0a03132aca9 (diff)
Sync with Linux 2.1.46.
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c11
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);
}
}