Blob Blame History Raw
From: stephen hemminger <stephen@networkplumber.org>
Date: Fri, 18 Aug 2017 13:46:21 -0700
Subject: net: make net_class ro_after_init
Patch-mainline: v4.14-rc1
Git-commit: e6d473e63536ea1989dc63c066f0c0464a969324
References: bsc#1109837

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>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 net/core/net-sysfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -1511,7 +1511,7 @@ static const void *net_namespace(struct
 	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,