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

Next file: linux/fs/proc/inode.c
Previous file: linux/fs/ncpfs/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.31/linux/fs/proc/fd.c linux/fs/proc/fd.c
@@ -106,8 +106,9 @@
 	if (!pid || i >= NR_TASKS)
 		return -ENOENT;
 
-	if (fd >= NR_OPEN || !p->files->fd[fd] || !p->files->fd[fd]->f_inode)
-	  return -ENOENT;
+	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