patch-2.1.45 linux/kernel/exit.c

Next file: linux/kernel/fork.c
Previous file: linux/ipc/shm.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/kernel/exit.c linux/kernel/exit.c
@@ -368,8 +368,11 @@
 			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;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov