Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190563
b: refs/heads/master
c: cf8304e
h: refs/heads/master
i:
  190561: d6e9266
  190559: 3432207
v: v3
  • Loading branch information
David Howells authored and James Morris committed May 5, 2010
1 parent d12ed52 commit 781f55d
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: d9a9b4aeea334e7912ce3d878d7f5cc6fdf1ffe4
refs/heads/master: cf8304e8f380903de3a15dc6ebd551c9e6cf1a21
9 changes: 6 additions & 3 deletions trunk/security/keys/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ static bool key_gc_keyring(struct key *keyring, time_t limit)
goto dont_gc;

/* scan the keyring looking for dead keys */
klist = rcu_dereference_check(keyring->payload.subscriptions,
lockdep_is_held(&key_serial_lock));
rcu_read_lock();
klist = rcu_dereference(keyring->payload.subscriptions);
if (!klist)
goto dont_gc;
goto unlock_dont_gc;

for (loop = klist->nkeys - 1; loop >= 0; loop--) {
key = klist->keys[loop];
Expand All @@ -89,11 +89,14 @@ static bool key_gc_keyring(struct key *keyring, time_t limit)
goto do_gc;
}

unlock_dont_gc:
rcu_read_unlock();
dont_gc:
kleave(" = false");
return false;

do_gc:
rcu_read_unlock();
key_gc_cursor = keyring->serial;
key_get(keyring);
spin_unlock(&key_serial_lock);
Expand Down

0 comments on commit 781f55d

Please sign in to comment.