net: make net_class ro_after_init
authorstephen hemminger <stephen@networkplumber.org>
Fri, 18 Aug 2017 20:46:21 +0000 (13:46 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Aug 2017 05:37:21 +0000 (22:37 -0700)
The net_class in sysfs is only modified on init.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net-sysfs.c

index 40937ee..99061b0 100644 (file)
@@ -1511,7 +1511,7 @@ static const void *net_namespace(struct device *d)
        return dev_net(dev);
 }
 
-static struct class net_class = {
+static struct class net_class __ro_after_init = {
        .name = "net",
        .dev_release = netdev_release,
        .dev_groups = net_class_groups,