net: Use RCU_POINTER_INITIALIZER() to init static variable
authorLi RongQing <lirongqing@baidu.com>
Mon, 25 Feb 2019 02:43:06 +0000 (10:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Feb 2019 22:50:22 +0000 (14:50 -0800)
This pointer is RCU protected, so proper primitives should be used.

Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_generic.c

index 38e5add14fab2bae1ce1426966069ea397b7f895..7bcee8b8f803da36a98fcfbbd52497ee5ea37cab 100644 (file)
@@ -559,7 +559,7 @@ struct Qdisc_ops noop_qdisc_ops __read_mostly = {
 };
 
 static struct netdev_queue noop_netdev_queue = {
-       .qdisc          =       &noop_qdisc,
+       RCU_POINTER_INITIALIZER(qdisc, &noop_qdisc),
        .qdisc_sleeping =       &noop_qdisc,
 };