[ATM]: fix bug in atm address list handling
From: Martin Whitaker <atm@martin-whitaker.co.uk>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
diff --git a/net/atm/addr.c b/net/atm/addr.c
index 1c8867f..a30d0bf 100644
--- a/net/atm/addr.c
+++ b/net/atm/addr.c
@@ -50,8 +50,10 @@
struct atm_dev_addr *this, *p;
spin_lock_irqsave(&dev->lock, flags);
- list_for_each_entry_safe(this, p, &dev->local, entry)
- kfree(this);
+ list_for_each_entry_safe(this, p, &dev->local, entry) {
+ list_del(&this->entry);
+ kfree(this);
+ }
spin_unlock_irqrestore(&dev->lock, flags);
notify_sigd(dev);
}