summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_netlink.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-10-04 16:43:56 -0700
committerDavid S. Miller <davem@davemloft.net>2015-10-04 16:43:56 -0700
commit68d4e5208291ac8bd7d47d992f353da31a2e1484 (patch)
tree017c1d62972036289cbb2111e1321471e0930353 /net/bridge/br_netlink.c
parente96f78ab2703f3b0d512f6b469bc685d2ef20475 (diff)
parent6be144f62f64c8a67e11b2f8b86c7bf390b87411 (diff)
downloadlinux-68d4e5208291ac8bd7d47d992f353da31a2e1484.tar.bz2
Merge branch 'bridge-vlan'
Nikolay Aleksandrov says: ==================== bridge: vlan: cleanups & fixes (part 2) This is the second follow-up set with one fix (patch 01) and more cleanups (patches 02,03 and 04). These are minor compared to the previous ones and should be the last before taking on the optimization changes on the fast-path. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r--net/bridge/br_netlink.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index c64dcad11662..c3186198d46d 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -34,7 +34,7 @@ static int __get_num_vlan_infos(struct net_bridge_vlan_group *vg,
pvid = br_get_pvid(vg);
/* Count number of vlan infos */
- list_for_each_entry(v, &vg->vlan_list, vlist) {
+ list_for_each_entry_rcu(v, &vg->vlan_list, vlist) {
flags = 0;
/* only a context, bridge vlan not activated */
if (!br_vlan_should_use(v))
@@ -76,13 +76,19 @@ initvars:
static int br_get_num_vlan_infos(struct net_bridge_vlan_group *vg,
u32 filter_mask)
{
+ int num_vlans;
+
if (!vg)
return 0;
if (filter_mask & RTEXT_FILTER_BRVLAN)
return vg->num_vlans;
- return __get_num_vlan_infos(vg, filter_mask);
+ rcu_read_lock();
+ num_vlans = __get_num_vlan_infos(vg, filter_mask);
+ rcu_read_unlock();
+
+ return num_vlans;
}
static size_t br_get_link_af_size_filtered(const struct net_device *dev,