Commit a29b0b74e73b66674d20a170e463fe9032f2272a

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent ec572e3f87

[PATCH] alloc_fdtable() expansion fix

We're supposed to go the next power of two if nfds==nr.

Of `nr', not of `nfsd'.

Spotted by Rene Scharfe <rene.scharfe@lsrfire.ath.cx>

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -240,7 +240,7 @@
240 240 if (!fdt)
241 241 goto out;
242 242  
243   - nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nfds));
  243 + nfds = max_t(int, 8 * L1_CACHE_BYTES, roundup_pow_of_two(nr + 1));
244 244 if (nfds > NR_OPEN)
245 245 nfds = NR_OPEN;
246 246