Skip to content

Commit 0293a50

Browse files
mochel@digitalimplant.orggregkh
authored andcommitted
[PATCH] Don't reference NULL klist pointer in klist_remove().
Signed-off-by: Patrick Mochel <mochel@digitalimplant.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> diff -Nru a/lib/klist.c b/lib/klist.c
1 parent 0956af5 commit 0293a50

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎lib/klist.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ EXPORT_SYMBOL_GPL(klist_del);
145145

146146
void klist_remove(struct klist_node * n)
147147
{
148-
spin_lock(&n->n_klist->k_lock);
148+
struct klist * k = n->n_klist;
149+
spin_lock(&k->k_lock);
149150
klist_dec_and_del(n);
150-
spin_unlock(&n->n_klist->k_lock);
151+
spin_unlock(&k->k_lock);
151152
wait_for_completion(&n->n_removed);
152153
}
153154

0 commit comments

Comments
 (0)