int err; 
static int futex_fd(unsigned long uaddr, int signal){	struct futex_q *q;	struct file *filp;	int ret, err;	ret = -EINVAL;	if (!valid_signal(signal))		goto out;	ret = get_unused_fd();	if (ret < 0)		goto out;	filp = get_empty_filp();	if (!filp) {		put_unused_fd(ret);		ret = -ENFILE;		goto out;	}	filp->f_op = &futex_fops;	filp->f_vfsmnt = mntget(futex_mnt);	filp->f_dentry = dget(futex_mnt->mnt_root);	filp->f_mapping = filp->f_dentry->d_inode->i_mapping;	if (signal) {		int err;		err = f_setown(filp, current->pid, 1);		if (err < 0) {			put_unused_fd(ret);			put_filp(filp);			ret = err;			goto out;		}		filp->f_owner.signum = signal;	}	q = kmalloc(sizeof(*q), GFP_KERNEL);	if (!q) {		put_unused_fd(ret);		put_filp(filp);		ret = -ENOMEM;		goto out;	}	down_read(&current->mm->mmap_sem);	err = get_futex_key(uaddr, &q->key);	if (unlikely(err != 0)) {		up_read(&current->mm->mmap_sem);		put_unused_fd(ret);		put_filp(filp);		kfree(q);		return err;	}	/*	 * queue_me() must be called before releasing mmap_sem, because	 * key->shared.inode needs to be referenced while holding it.	 */	filp->private_data = q;	queue_me(q, ret, filp);	up_read(&current->mm->mmap_sem);	/* Now we map fd to filp, so userspace can access it */	fd_install(ret, filp);out:	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/39ed3fdeec1290dd246dcf1da6b278566987a084/futex.c/buggy/kernel/futex.c