diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 84751f3f52d5..d0087a0b024b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1039,6 +1039,7 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) | |||
1039 | int retval; | 1039 | int retval; |
1040 | char buf[NUMBUF]; | 1040 | char buf[NUMBUF]; |
1041 | struct files_struct * files; | 1041 | struct files_struct * files; |
1042 | struct fdtable *fdt; | ||
1042 | 1043 | ||
1043 | retval = -ENOENT; | 1044 | retval = -ENOENT; |
1044 | if (!pid_alive(p)) | 1045 | if (!pid_alive(p)) |
@@ -1062,8 +1063,9 @@ static int proc_readfd(struct file * filp, void * dirent, filldir_t filldir) | |||
1062 | if (!files) | 1063 | if (!files) |
1063 | goto out; | 1064 | goto out; |
1064 | spin_lock(&files->file_lock); | 1065 | spin_lock(&files->file_lock); |
1066 | fdt = files_fdtable(files); | ||
1065 | for (fd = filp->f_pos-2; | 1067 | for (fd = filp->f_pos-2; |
1066 | fd < files->max_fds; | 1068 | fd < fdt->max_fds; |
1067 | fd++, filp->f_pos++) { | 1069 | fd++, filp->f_pos++) { |
1068 | unsigned int i,j; | 1070 | unsigned int i,j; |
1069 | 1071 | ||