diff options
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c index dc4a7007f4e7..03c789560fb8 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c | |||
@@ -73,8 +73,8 @@ repeat: | |||
73 | * orig_start..fdt->next_fd | 73 | * orig_start..fdt->next_fd |
74 | */ | 74 | */ |
75 | start = orig_start; | 75 | start = orig_start; |
76 | if (start < fdt->next_fd) | 76 | if (start < files->next_fd) |
77 | start = fdt->next_fd; | 77 | start = files->next_fd; |
78 | 78 | ||
79 | newfd = start; | 79 | newfd = start; |
80 | if (start < fdt->max_fdset) { | 80 | if (start < fdt->max_fdset) { |
@@ -102,9 +102,8 @@ repeat: | |||
102 | * we reacquire the fdtable pointer and use it while holding | 102 | * we reacquire the fdtable pointer and use it while holding |
103 | * the lock, no one can free it during that time. | 103 | * the lock, no one can free it during that time. |
104 | */ | 104 | */ |
105 | fdt = files_fdtable(files); | 105 | if (start <= files->next_fd) |
106 | if (start <= fdt->next_fd) | 106 | files->next_fd = newfd + 1; |
107 | fdt->next_fd = newfd + 1; | ||
108 | 107 | ||
109 | error = newfd; | 108 | error = newfd; |
110 | 109 | ||