From foo@baz Tue Apr 9 12:12:43 2002 To: Greg KH Date: 24 Mar 2005 18:59:59 -08:00 From: mochel@digitalimplant.org Subject: [klist] Don't reference NULL klist pointer in klist_remove(). Signed-off-by: Patrick Mochel Signed-off-by: Greg Kroah-Hartman diff -Nru a/lib/klist.c b/lib/klist.c --- a/lib/klist.c 2005-04-05 10:51:48 -07:00 +++ b/lib/klist.c 2005-04-05 10:51:48 -07:00 @@ -145,9 +145,10 @@ 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); }