|
@@ -151,7 +151,9 @@ static void keyring_destroy(struct key *keyring)
|
|
|
write_unlock(&keyring_name_lock);
|
|
|
}
|
|
|
|
|
|
- klist = rcu_dereference(keyring->payload.subscriptions);
|
|
|
+ klist = rcu_dereference_check(keyring->payload.subscriptions,
|
|
|
+ rcu_read_lock_held() ||
|
|
|
+ atomic_read(&keyring->usage) == 0);
|
|
|
if (klist) {
|
|
|
for (loop = klist->nkeys - 1; loop >= 0; loop--)
|
|
|
key_put(klist->keys[loop]);
|