diff mbox series

[net-next] net: Use RCU_POINTER_INITIALIZER() to init static variable

Message ID 1551062586-5658-1-git-send-email-lirongqing@baidu.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] net: Use RCU_POINTER_INITIALIZER() to init static variable | expand

Commit Message

Li RongQing Feb. 25, 2019, 2:43 a.m. UTC
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>
---
 net/sched/sch_generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Feb. 26, 2019, 10:52 p.m. UTC | #1
From: Li RongQing <lirongqing@baidu.com>
Date: Mon, 25 Feb 2019 10:43:06 +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>

Applied.
diff mbox series

Patch

diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
index 38e5add14fab..7bcee8b8f803 100644
--- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c
@@ -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,
 };