diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-05-11 12:59:32 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-05-11 12:59:37 +0200 | 
| commit | 7961386fe9596e6bf03d09948a73c5df9653325b (patch) | |
| tree | 60fa2586a0d340ef8f7473956eef17430d8250c7 /security/keys/request_key.c | |
| parent | aa47b7e0f89b9998dad4d1667447e8cb7703ff4e (diff) | |
| parent | 091bf7624d1c90cec9e578a18529f615213ff847 (diff) | |
| download | olio-linux-3.10-7961386fe9596e6bf03d09948a73c5df9653325b.tar.xz olio-linux-3.10-7961386fe9596e6bf03d09948a73c5df9653325b.zip  | |
Merge commit 'v2.6.30-rc5' into sched/core
Merge reason: sched/core was on .30-rc1 before, update to latest fixes
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'security/keys/request_key.c')
| -rw-r--r-- | security/keys/request_key.c | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index 22a31582bfa..03fe63ed55b 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c @@ -311,7 +311,8 @@ static int construct_alloc_key(struct key_type *type,  	set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags); -	down_write(&dest_keyring->sem); +	if (dest_keyring) +		down_write(&dest_keyring->sem);  	/* attach the key to the destination keyring under lock, but we do need  	 * to do another check just in case someone beat us to it whilst we @@ -322,10 +323,12 @@ static int construct_alloc_key(struct key_type *type,  	if (!IS_ERR(key_ref))  		goto key_already_present; -	__key_link(dest_keyring, key); +	if (dest_keyring) +		__key_link(dest_keyring, key);  	mutex_unlock(&key_construction_mutex); -	up_write(&dest_keyring->sem); +	if (dest_keyring) +		up_write(&dest_keyring->sem);  	mutex_unlock(&user->cons_lock);  	*_key = key;  	kleave(" = 0 [%d]", key_serial(key));  |