projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
be2net: Fix setting QoS for VF for Lancer
[firefly-linux-kernel-4.4.55.git]
/
fs
/
file.c
diff --git
a/fs/file.c
b/fs/file.c
index 0f1bda4bebfaa77280a1234a2b8e19edb4b8d94b..d3b5fa80b71b76a973919a6b9cfa2ebb34096adf 100644
(file)
--- a/
fs/file.c
+++ b/
fs/file.c
@@
-922,6
+922,9
@@
SYSCALL_DEFINE3(dup3, unsigned int, oldfd, unsigned int, newfd, int, flags)
if ((flags & ~O_CLOEXEC) != 0)
return -EINVAL;
+ if (unlikely(oldfd == newfd))
+ return -EINVAL;
+
if (newfd >= rlimit(RLIMIT_NOFILE))
return -EMFILE;