Skip to content

Commit 5fb1514

Browse files
author
Al Viro
committed
readdir.c: get rid of the last __put_user(), drop now-useless access_ok()
Signed-off-by: Al Viro <[email protected]>
1 parent 82af599 commit 5fb1514

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

fs/readdir.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,6 @@ SYSCALL_DEFINE3(getdents, unsigned int, fd,
276276
};
277277
int error;
278278

279-
if (!access_ok(dirent, count))
280-
return -EFAULT;
281-
282279
f = fdget_pos(fd);
283280
if (!f.file)
284281
return -EBADF;
@@ -362,9 +359,6 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent,
362359
};
363360
int error;
364361

365-
if (!access_ok(dirent, count))
366-
return -EFAULT;
367-
368362
f = fdget_pos(fd);
369363
if (!f.file)
370364
return -EBADF;
@@ -377,7 +371,7 @@ int ksys_getdents64(unsigned int fd, struct linux_dirent64 __user *dirent,
377371
typeof(lastdirent->d_off) d_off = buf.ctx.pos;
378372

379373
lastdirent = (void __user *) buf.current_dir - buf.prev_reclen;
380-
if (__put_user(d_off, &lastdirent->d_off))
374+
if (put_user(d_off, &lastdirent->d_off))
381375
error = -EFAULT;
382376
else
383377
error = count - buf.count;
@@ -537,9 +531,6 @@ COMPAT_SYSCALL_DEFINE3(getdents, unsigned int, fd,
537531
};
538532
int error;
539533

540-
if (!access_ok(dirent, count))
541-
return -EFAULT;
542-
543534
f = fdget_pos(fd);
544535
if (!f.file)
545536
return -EBADF;

0 commit comments

Comments
 (0)