if (file == tfile || !IS_FILE_EPOLL(file)) 
if (file == tfile || !is_file_epoll(file)) 
sys_epoll_ctl(int epfd, int op, int fd, struct epoll_event __user *event){	int error;	struct file *file, *tfile;	struct eventpoll *ep;	struct epitem *epi;	struct epoll_event epds;	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_ctl(%d, %d, %d, %p)\n",		     current, epfd, op, fd, event));	error = -EFAULT;	if (EP_OP_HASH_EVENT(op) &&	    copy_from_user(&epds, event, sizeof(struct epoll_event)))		goto eexit_1;	/* Get the "struct file *" for the eventpoll file */	error = -EBADF;	file = fget(epfd);	if (!file)		goto eexit_1;	/* Get the "struct file *" for the target file */	tfile = fget(fd);	if (!tfile)		goto eexit_2;	/* The target file descriptor must support poll */	error = -EPERM;	if (!tfile->f_op || !tfile->f_op->poll)		goto eexit_3;	/*	 * We have to check that the file structure underneath the file descriptor	 * the user passed to us _is_ an eventpoll file. And also we do not permit	 * adding an epoll file descriptor inside itself.	 */	error = -EINVAL;	if (file == tfile || !IS_FILE_EPOLL(file))		goto eexit_3;	/*	 * At this point it is safe to assume that the "private_data" contains	 * our own data structure.	 */	ep = file->private_data;	down_write(&ep->sem);	/* Try to lookup the file inside our hash table */	epi = ep_find(ep, tfile, fd);	error = -EINVAL;	switch (op) {	case EPOLL_CTL_ADD:		if (!epi) {			epds.events |= POLLERR | POLLHUP;			error = ep_insert(ep, &epds, tfile, fd);		} else			error = -EEXIST;		break;	case EPOLL_CTL_DEL:		if (epi)			error = ep_remove(ep, epi);		else			error = -ENOENT;		break;	case EPOLL_CTL_MOD:		if (epi) {			epds.events |= POLLERR | POLLHUP;			error = ep_modify(ep, epi, &epds);		} else			error = -ENOENT;		break;	}	/*	 * The function ep_find() increments the usage count of the structure	 * so, if this is not NULL, we need to release it.	 */	if (epi)		ep_release_epitem(epi);	up_write(&ep->sem);eexit_3:	fput(tfile);eexit_2:	fput(file);eexit_1:	DNPRINTK(3, (KERN_INFO "[%p] eventpoll: sys_epoll_ctl(%d, %d, %d, %p) = %d\n",		     current, epfd, op, fd, event, error));	return error;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/b030a4dd609e167da7f73c2d1fa5af864a0aea17/eventpoll.c/buggy/fs/eventpoll.c