patch-2.1.30 linux/fs/proc/fd.c

Next file: linux/fs/proc/generic.c
Previous file: linux/fs/proc/array.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/fs/proc/fd.c linux/fs/proc/fd.c
@@ -106,7 +106,13 @@
 	if (!pid || i >= NR_TASKS)
 		return -ENOENT;
 
-	if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode)
+	/*
+	 *	File handle is invalid if it is out of range, if the process
+	 *	has no files (Zombie) if the file is closed, or if its inode
+	 *	is NULL
+	 */
+
+ 	if (fd >= NR_OPEN || !p->files || !p->files->fd[fd] || !p->files->fd[fd]->f_inode)
 	  return -ENOENT;
 
 	ino = (pid << 16) + (PROC_PID_FD_DIR << 8) + fd;

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