diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/osf_sys.c | 7 | ||||
-rw-r--r-- | arch/parisc/hpux/fs.c | 5 |
2 files changed, 4 insertions, 8 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 8509dad31204..f25f6c490952 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -165,14 +165,11 @@ osf_getdirentries(unsigned int fd, struct osf_dirent __user *dirent, | |||
165 | buf.error = 0; | 165 | buf.error = 0; |
166 | 166 | ||
167 | error = vfs_readdir(file, osf_filldir, &buf); | 167 | error = vfs_readdir(file, osf_filldir, &buf); |
168 | if (error < 0) | 168 | if (error >= 0) |
169 | goto out_putf; | 169 | error = buf.error; |
170 | |||
171 | error = buf.error; | ||
172 | if (count != buf.count) | 170 | if (count != buf.count) |
173 | error = count - buf.count; | 171 | error = count - buf.count; |
174 | 172 | ||
175 | out_putf: | ||
176 | fput(file); | 173 | fput(file); |
177 | out: | 174 | out: |
178 | return error; | 175 | return error; |
diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 12c04c5e558b..bd9a4db3bd4c 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c | |||
@@ -127,9 +127,8 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned i | |||
127 | buf.error = 0; | 127 | buf.error = 0; |
128 | 128 | ||
129 | error = vfs_readdir(file, filldir, &buf); | 129 | error = vfs_readdir(file, filldir, &buf); |
130 | if (error < 0) | 130 | if (error >= 0) |
131 | goto out_putf; | 131 | error = buf.error; |
132 | error = buf.error; | ||
133 | lastdirent = buf.previous; | 132 | lastdirent = buf.previous; |
134 | if (lastdirent) { | 133 | if (lastdirent) { |
135 | if (put_user(file->f_pos, &lastdirent->d_off)) | 134 | if (put_user(file->f_pos, &lastdirent->d_off)) |