X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=fs%2Fselect.c;h=dcbc1112b7ec214c063eaf5786bb17d5f208e6b0;hb=2ae88149a27cadf2840e0ab8155bef13be285c03;hp=33b72ba0f86f45790bd7661053266cd8336c9757;hpb=61b9175808670d9abf52156803ae0ed1e3706ac4;p=powerpc.git diff --git a/fs/select.c b/fs/select.c index 33b72ba0f8..dcbc1112b7 100644 --- a/fs/select.c +++ b/fs/select.c @@ -658,8 +658,6 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout) unsigned int i; struct poll_list *head; struct poll_list *walk; - struct fdtable *fdt; - int max_fdset; /* Allocate small arguments on the stack to save memory and be faster - use long to make sure the buffer is aligned properly on 64 bit archs to avoid unaligned access */ @@ -667,11 +665,7 @@ int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds, s64 *timeout) struct poll_list *stack_pp = NULL; /* Do a sanity check on nfds ... */ - rcu_read_lock(); - fdt = files_fdtable(current->files); - max_fdset = fdt->max_fdset; - rcu_read_unlock(); - if (nfds > max_fdset && nfds > OPEN_MAX) + if (nfds > current->signal->rlim[RLIMIT_NOFILE].rlim_cur) return -EINVAL; poll_initwait(&table);