diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-21 22:00:56 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-21 22:00:56 +0000 |
commit | 168660f24dfc46c2702acbe4701a446f42a59578 (patch) | |
tree | f431368afbf6b1b71809cf3fd904d800ea126f4d /fs/select.c | |
parent | 6420f767924fa73b0ea267864d96820815f4ba5a (diff) |
Merge with Linux 2.4.0-test5-pre3.
Diffstat (limited to 'fs/select.c')
-rw-r--r-- | fs/select.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/select.c b/fs/select.c index be09afdd7..a5c213930 100644 --- a/fs/select.c +++ b/fs/select.c @@ -221,6 +221,16 @@ int do_select(int n, fd_set_bits *fds, long *timeout) return retval; } +static void *select_bits_alloc(int size) +{ + return kmalloc(6 * size, GFP_KERNEL); +} + +static void select_bits_free(void *bits, int size) +{ + kfree(bits); +} + /* * We can actually return ERESTARTSYS instead of EINTR, but I'd * like to be certain this leads to no problems. So I return @@ -273,7 +283,7 @@ sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp) */ ret = -ENOMEM; size = FDS_BYTES(n); - bits = kmalloc(6 * size, GFP_KERNEL); + bits = select_bits_alloc(size); if (!bits) goto out_nofds; fds.in = (unsigned long *) bits; @@ -318,7 +328,7 @@ sys_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, struct timeval *tvp) set_fd_set(n, exp, fds.res_ex); out: - kfree(bits); + select_bits_free(bits, size); out_nofds: return ret; } |