diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c index e8027b794e8c..27b0b6567d52 100644 --- a/drivers/net/vxlan/vxlan_core.c +++ b/drivers/net/vxlan/vxlan_core.c @@ -4750,7 +4750,8 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) struct ifla_vxlan_port_range ports; const struct vxlan_config *cfg; - cfg = rtnl_dereference(vxlan->cfg); + rcu_read_lock(); + cfg = rcu_dereference(vxlan->cfg); if (nla_put_u32(skb, IFLA_VXLAN_ID, be32_to_cpu(cfg->vni))) goto nla_put_failure; @@ -4849,9 +4850,11 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev) &cfg->reserved_bits)) goto nla_put_failure; + rcu_read_unlock(); return 0; nla_put_failure: + rcu_read_unlock(); return -EMSGSIZE; }