From: mochel@digitalimplant.org Date: Fri, 25 Mar 2005 02:59:59 +0000 (-0800) Subject: [PATCH] Don't reference NULL klist pointer in klist_remove(). X-Git-Tag: MMI-PSA29.97-13-9~54849^2~21^2~172^2~40 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0293a509405dccecc30783a5d729d615b68d6a77;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [PATCH] 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 --- 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); }