Skip to content

Commit

Permalink
[PATCH] Don't reference NULL klist pointer in klist_remove().
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mochel@digitalimplant.org authored and Greg Kroah-Hartman committed Jun 20, 2005
1 parent 0956af5 commit 0293a50
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/klist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0293a50

Please sign in to comment.