summaryrefslogtreecommitdiffstats
path: root/lib/klist.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/klist.c')
-rw-r--r--lib/klist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/klist.c b/lib/klist.c
index 02177d72dc89..738ab810160a 100644
--- a/lib/klist.c
+++ b/lib/klist.c
@@ -145,9 +145,10 @@ EXPORT_SYMBOL_GPL(klist_del);
void klist_remove(struct klist_node * n)
{
- spin_lock(&n->n_klist->k_lock);
+ struct klist * k = n->n_klist;
+ spin_lock(&k->k_lock);
klist_dec_and_del(n);
- spin_unlock(&n->n_klist->k_lock);
+ spin_unlock(&k->k_lock);
wait_for_completion(&n->n_removed);
}