diff options
Diffstat (limited to 'fs/readdir.c')
| -rw-r--r-- | fs/readdir.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/readdir.c b/fs/readdir.c index b95ded581471..b03579bc0210 100644 --- a/fs/readdir.c +++ b/fs/readdir.c @@ -287,9 +287,10 @@ asmlinkage long sys_getdents64(unsigned int fd, struct linux_dirent64 __user * d lastdirent = buf.previous; if (lastdirent) { typeof(lastdirent->d_off) d_off = file->f_pos; - error = count - buf.count; + error = -EFAULT; if (__put_user(d_off, &lastdirent->d_off)) - error = -EFAULT; + goto out_putf; + error = count - buf.count; } out_putf: |
