if (!negative) 
if (!negated) 
static struct key *__request_key_construction(struct key_type *type,					      const char *description,					      const char *callout_info){	struct key_construction cons;	struct timespec now;	struct key *key;	int ret, negative;	/* create a key and add it to the queue */	key = key_alloc(type, description,			current->fsuid, current->fsgid, KEY_USR_ALL, 0);	if (IS_ERR(key))		goto alloc_failed;	write_lock(&key->lock);	key->flags |= KEY_FLAG_USER_CONSTRUCT;	write_unlock(&key->lock);	cons.key = key;	list_add_tail(&cons.link, &key->user->consq);	/* we drop the construction sem here on behalf of the caller */	up_write(&key_construction_sem);	/* make the call */	ret = call_request_key(key, "create", callout_info);	if (ret < 0)		goto request_failed;	/* if the key wasn't instantiated, then we want to give an error */	ret = -ENOKEY;	if (!(key->flags & KEY_FLAG_INSTANTIATED))		goto request_failed;	down_write(&key_construction_sem);	list_del(&cons.link);	up_write(&key_construction_sem);	/* also give an error if the key was negatively instantiated */ check_not_negative:	if (key->flags & KEY_FLAG_NEGATIVE) {		key_put(key);		key = ERR_PTR(-ENOKEY);	} out:	return key; request_failed:	/* it wasn't instantiated	 * - remove from construction queue	 * - mark the key as dead	 */	negative = 0;	down_write(&key_construction_sem);	list_del(&cons.link);	write_lock(&key->lock);	key->flags &= ~KEY_FLAG_USER_CONSTRUCT;	/* check it didn't get instantiated between the check and the down */	if (!(key->flags & KEY_FLAG_INSTANTIATED)) {		key->flags |= KEY_FLAG_INSTANTIATED | KEY_FLAG_NEGATIVE;		negative = 1;	}	write_unlock(&key->lock);	up_write(&key_construction_sem);	if (!negative)		goto check_not_negative; /* surprisingly, the key got					  * instantiated */	/* set the timeout and store in the session keyring if we can */	now = current_kernel_time();	key->expiry = now.tv_sec + key_negative_timeout;	if (current->signal->session_keyring) {		unsigned long flags;		struct key *keyring;		spin_lock_irqsave(&current->sighand->siglock, flags);		keyring = current->signal->session_keyring;		atomic_inc(&keyring->usage);		spin_unlock_irqrestore(&current->sighand->siglock, flags);		key_link(keyring, key);		key_put(keyring);	}	key_put(key);	/* notify anyone who was waiting */	wake_up_all(&request_key_conswq);	key = ERR_PTR(ret);	goto out; alloc_failed:	up_write(&key_construction_sem);	goto out;} /* end __request_key_construction() */
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/76d8aeabfeb1c42641a81c44280177b9a08670d8/request_key.c/buggy/security/keys/request_key.c