Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142931
b: refs/heads/master
c: 34574dd
h: refs/heads/master
i:
  142929: 5a33797
  142927: 4b5f7b0
v: v3
  • Loading branch information
David Howells authored and Linus Torvalds committed Apr 9, 2009
1 parent 877a150 commit 9526c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 11ff5f6affe9b75f115a900a5584db339d46002b
refs/heads/master: 34574dd10b6d0697b86703388d6d6af9cbf4bb48
9 changes: 6 additions & 3 deletions trunk/security/keys/request_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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));
Expand Down

0 comments on commit 9526c2b

Please sign in to comment.