]> git.neil.brown.name Git - history.git/commitdiff
[NET]: Prevent 'eth0: driver changed get_stats after register' from lying.
authorRussell King <rmk@arm.linux.org.uk>
Sat, 18 Oct 2003 17:08:39 +0000 (10:08 -0700)
committerRussell King <rmk@arm.linux.org.uk>
Sat, 18 Oct 2003 17:08:39 +0000 (10:08 -0700)
net/core/net-sysfs.c

index ae9b5c8e8098328c5fc517ddbc75a1bcd730b039..5281a1eb6c0b676ed0c3e85d86eb5b249509daaa 100644 (file)
@@ -408,6 +408,7 @@ int netdev_register_sysfs(struct net_device *net)
 
        class_dev->class = &net_class;
        class_dev->class_data = net;
+       net->last_stats = net->get_stats;
 
        strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE);
        if ((ret = class_device_register(class_dev)))
@@ -419,7 +420,6 @@ int netdev_register_sysfs(struct net_device *net)
        }
 
 
-       net->last_stats = net->get_stats;
        if (net->get_stats &&
            (ret = sysfs_create_group(&class_dev->kobj, &netstat_group)))
                goto out_unreg;