Commit 5fb15141 authored by Al Viro's avatar Al Viro

readdir.c: get rid of the last __put_user(), drop now-useless access_ok()

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 82af599b
...@@ -276,9 +276,6 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd, ...@@ -276,9 +276,6 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
}; };
int error; int error;
if (!access_ok(dirent, count))
return -EFAULT;
f = fdget_pos(fd); f = fdget_pos(fd);
if (!f.file) if (!f.file)
return -EBADF; return -EBADF;
...@@ -362,9 +359,6 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, ...@@ -362,9 +359,6 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent,
}; };
int error; int error;
if (!access_ok(dirent, count))
return -EFAULT;
f = fdget_pos(fd); f = fdget_pos(fd);
if (!f.file) if (!f.file)
return -EBADF; return -EBADF;
...@@ -377,7 +371,7 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent, ...@@ -377,7 +371,7 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent,
typeof(lastdirent->d_off) d_off = buf.ctx.pos; typeof(lastdirent->d_off) d_off = buf.ctx.pos;
lastdirent = (void __user *) buf.current_dir - buf.prev_reclen; lastdirent = (void __user *) buf.current_dir - buf.prev_reclen;
if (__put_user(d_off, &lastdirent->d_off)) if (put_user(d_off, &lastdirent->d_off))
error = -EFAULT; error = -EFAULT;
else else
error = count - buf.count; error = count - buf.count;
...@@ -537,9 +531,6 @@ COMPAT_SYSCALL_DEFINE3(getdents, unsigned int, fd, ...@@ -537,9 +531,6 @@ COMPAT_SYSCALL_DEFINE3(getdents, unsigned int, fd,
}; };
int error; int error;
if (!access_ok(dirent, count))
return -EFAULT;
f = fdget_pos(fd); f = fdget_pos(fd);
if (!f.file) if (!f.file)
return -EBADF; return -EBADF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment