]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/dev.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[linux-2.6-omap-h63xx.git] / net / core / dev.c
index f2b61111e26d5c5c16d621e548065a8fed15dfcd..ee051bb398a02fb88bf4ca185534a477529acb8f 100644 (file)
@@ -2009,6 +2009,7 @@ static void net_rx_action(struct softirq_action *h)
                }
        }
 out:
+       local_irq_enable();
 #ifdef CONFIG_NET_DMA
        /*
         * There may not be any more sk_buffs coming right now, so push
@@ -2022,7 +2023,6 @@ out:
                rcu_read_unlock();
        }
 #endif
-       local_irq_enable();
        return;
 
 softnet_break:
@@ -2577,7 +2577,7 @@ unsigned dev_get_flags(const struct net_device *dev)
 
 int dev_change_flags(struct net_device *dev, unsigned flags)
 {
-       int ret;
+       int ret, changes;
        int old_flags = dev->flags;
 
        /*
@@ -2632,8 +2632,10 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
                dev_set_allmulti(dev, inc);
        }
 
-       if (old_flags ^ dev->flags)
-               rtmsg_ifinfo(RTM_NEWLINK, dev, old_flags ^ dev->flags);
+       /* Exclude state transition flags, already notified */
+       changes = (old_flags ^ dev->flags) & ~(IFF_UP | IFF_RUNNING);
+       if (changes)
+               rtmsg_ifinfo(RTM_NEWLINK, dev, changes);
 
        return ret;
 }
@@ -3314,7 +3316,6 @@ void netdev_run_todo(void)
                        continue;
                }
 
-               netdev_unregister_sysfs(dev);
                dev->reg_state = NETREG_UNREGISTERED;
 
                netdev_wait_allrefs(dev);
@@ -3325,11 +3326,11 @@ void netdev_run_todo(void)
                BUG_TRAP(!dev->ip6_ptr);
                BUG_TRAP(!dev->dn_ptr);
 
-               /* It must be the very last action,
-                * after this 'dev' may point to freed up memory.
-                */
                if (dev->destructor)
                        dev->destructor(dev);
+
+               /* Free network device */
+               kobject_put(&dev->dev.kobj);
        }
 
 out:
@@ -3480,6 +3481,9 @@ void unregister_netdevice(struct net_device *dev)
        /* Notifier chain MUST detach us from master device. */
        BUG_TRAP(!dev->master);
 
+       /* Remove entries from sysfs */
+       netdev_unregister_sysfs(dev);
+
        /* Finish processing unregister after unlock */
        net_set_todo(dev);