mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
take rlimit check to callers of expand_files()
... except for one in android, where the check is different and already done in caller. No need to recalculate rlimit many times in alloc_fd() either. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
352e3b2492
commit
f33ff9927f
2 changed files with 12 additions and 7 deletions
|
|
@ -64,6 +64,9 @@ SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
|
|||
if (unlikely(oldfd == newfd))
|
||||
return -EINVAL;
|
||||
|
||||
if (newfd >= rlimit(RLIMIT_NOFILE))
|
||||
return -EMFILE;
|
||||
|
||||
spin_lock(&files->file_lock);
|
||||
err = expand_files(files, newfd);
|
||||
file = fcheck(oldfd);
|
||||
|
|
|
|||
Loading…
Reference in a new issue