author: Linus Torvalds <torvalds@linux-foundation.org> 2015-10-31 16:06:40 -0700
committer: Linus Torvalds <torvalds@linux-foundation.org> 2015-10-31 16:14:51 -0700
commit: fc90888d07b8e17eec49c04bdb26344fdea96c3b
parent: f3f86e33dc3da437fa4f204588ce7c78ea756982
Commit Summary:
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/fs/file.c b/fs/file.c
index 6f6eb2b03af5..c6986dce0334 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -236,7 +236,8 @@ static inline void __set_close_on_exec(int fd, struct fdtable *fdt)
static inline void __clear_close_on_exec(int fd, struct fdtable *fdt)
{
- __clear_bit(fd, fdt->close_on_exec);
+ if (test_bit(fd, fdt->close_on_exec))
+ __clear_bit(fd, fdt->close_on_exec);
}
static inline void __set_open_fd(unsigned int fd, struct fdtable *fdt)