mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
[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
This commit is contained in:
parent
0956af53af
commit
0293a50940
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user