summaryrefslogtreecommitdiffstats
path: root/fs/select.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-18 22:06:10 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-18 22:06:10 +0000
commitaba4e552a2f2c1492441acbccedd8e0a4c53f916 (patch)
tree23921efb2b4af590160f034a89ff3da2ecca6e47 /fs/select.c
parent9e17e1aa1cf1cb497d2f67147a51831888affcf3 (diff)
Merge with Linux 2.3.43.
Diffstat (limited to 'fs/select.c')
-rw-r--r--fs/select.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/select.c b/fs/select.c
index b664d3e81..7df7e0c9b 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -414,11 +414,14 @@ asmlinkage long sys_poll(struct pollfd * ufds, unsigned int nfds, long timeout)
wait = wait_table;
}
- fds = (struct pollfd **)kmalloc(
- (1 + (nfds - 1) / POLLFD_PER_PAGE) * sizeof(struct pollfd *),
- GFP_KERNEL);
- if (fds == NULL)
- goto out;
+ fds = NULL;
+ if (nfds != 0) {
+ fds = (struct pollfd **)kmalloc(
+ (1 + (nfds - 1) / POLLFD_PER_PAGE) * sizeof(struct pollfd *),
+ GFP_KERNEL);
+ if (fds == NULL)
+ goto out;
+ }
nchunks = 0;
nleft = nfds;
@@ -467,7 +470,8 @@ out_fds1:
out_fds:
for (i=0; i < nchunks; i++)
free_page((unsigned long)(fds[i]));
- kfree(fds);
+ if (nfds != 0)
+ kfree(fds);
out:
if (wait)
free_wait(wait_table);