aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bridge/br_netlink.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 3de0eefe2b82..c72083968768 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -81,17 +81,19 @@ static size_t br_get_link_af_size_filtered(const struct net_device *dev,
81 struct net_port_vlans *pv; 81 struct net_port_vlans *pv;
82 int num_vlan_infos; 82 int num_vlan_infos;
83 83
84 rcu_read_lock();
84 if (br_port_exists(dev)) 85 if (br_port_exists(dev))
85 pv = nbp_get_vlan_info(br_port_get_rtnl(dev)); 86 pv = nbp_get_vlan_info(br_port_get_rcu(dev));
86 else if (dev->priv_flags & IFF_EBRIDGE) 87 else if (dev->priv_flags & IFF_EBRIDGE)
87 pv = br_get_vlan_info((struct net_bridge *)netdev_priv(dev)); 88 pv = br_get_vlan_info((struct net_bridge *)netdev_priv(dev));
88 else 89 else
89 return 0; 90 pv = NULL;
90 91 if (pv)
91 if (!pv) 92 num_vlan_infos = br_get_num_vlan_infos(pv, filter_mask);
92 return 0; 93 else
94 num_vlan_infos = 0;
95 rcu_read_unlock();
93 96
94 num_vlan_infos = br_get_num_vlan_infos(pv, filter_mask);
95 if (!num_vlan_infos) 97 if (!num_vlan_infos)
96 return 0; 98 return 0;
97 99