aboutsummaryrefslogtreecommitdiffstats
path: root/security/keys/gc.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /security/keys/gc.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'security/keys/gc.c')
-rw-r--r--security/keys/gc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/security/keys/gc.c b/security/keys/gc.c
index 4770be375ffe..a46e825cbf02 100644
--- a/security/keys/gc.c
+++ b/security/keys/gc.c
@@ -77,9 +77,10 @@ static bool key_gc_keyring(struct key *keyring, time_t limit)
77 goto dont_gc; 77 goto dont_gc;
78 78
79 /* scan the keyring looking for dead keys */ 79 /* scan the keyring looking for dead keys */
80 rcu_read_lock();
80 klist = rcu_dereference(keyring->payload.subscriptions); 81 klist = rcu_dereference(keyring->payload.subscriptions);
81 if (!klist) 82 if (!klist)
82 goto dont_gc; 83 goto unlock_dont_gc;
83 84
84 for (loop = klist->nkeys - 1; loop >= 0; loop--) { 85 for (loop = klist->nkeys - 1; loop >= 0; loop--) {
85 key = klist->keys[loop]; 86 key = klist->keys[loop];
@@ -88,11 +89,14 @@ static bool key_gc_keyring(struct key *keyring, time_t limit)
88 goto do_gc; 89 goto do_gc;
89 } 90 }
90 91
92unlock_dont_gc:
93 rcu_read_unlock();
91dont_gc: 94dont_gc:
92 kleave(" = false"); 95 kleave(" = false");
93 return false; 96 return false;
94 97
95do_gc: 98do_gc:
99 rcu_read_unlock();
96 key_gc_cursor = keyring->serial; 100 key_gc_cursor = keyring->serial;
97 key_get(keyring); 101 key_get(keyring);
98 spin_unlock(&key_serial_lock); 102 spin_unlock(&key_serial_lock);