ax25: Fix reference count leak issue of net_device
[linux-2.6-block.git] / net / ax25 / ax25_dev.c
index 52ccc37d5687a4ce58be9c802ce159eee865cc5f..c9d55b99a7a570e742b7220b2f0641a723ab9171 100644 (file)
@@ -118,15 +118,10 @@ void ax25_dev_device_down(struct net_device *dev)
        list_for_each_entry(s, &ax25_dev_list, list) {
                if (s == ax25_dev) {
                        list_del(&s->list);
-                       goto unlock_put;
+                       break;
                }
        }
-       dev->ax25_ptr = NULL;
-       spin_unlock_bh(&ax25_dev_lock);
-       ax25_dev_put(ax25_dev);
-       return;
 
-unlock_put:
        dev->ax25_ptr = NULL;
        spin_unlock_bh(&ax25_dev_lock);
        netdev_put(dev, &ax25_dev->dev_tracker);