[9/12] More Driver Model Locking Changes

From: Patrick Mochel
Date: Fri Mar 25 2005 - 01:14:13 EST



ChangeSet@xxxxxx, 2005-03-24 18:59:59-08:00, mochel@xxxxxxxxxxxxxxxxxx
[klist] Don't reference NULL klist pointer in klist_remove().


Signed-off-by: Patrick Mochel <mochel@xxxxxxxxxxxxxxxxxx>

diff -Nru a/lib/klist.c b/lib/klist.c
--- a/lib/klist.c 2005-03-24 20:33:01 -08:00
+++ b/lib/klist.c 2005-03-24 20:33:01 -08: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);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/