summaryrefslogtreecommitdiffstats
path: root/net/bridge/br_mst.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_mst.c')
-rw-r--r--net/bridge/br_mst.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/net/bridge/br_mst.c b/net/bridge/br_mst.c
index 3c66141d34..ee680adcee 100644
--- a/net/bridge/br_mst.c
+++ b/net/bridge/br_mst.c
@@ -78,7 +78,7 @@ static void br_mst_vlan_set_state(struct net_bridge_port *p, struct net_bridge_v
{
struct net_bridge_vlan_group *vg = nbp_vlan_group(p);
- if (br_vlan_get_state(v) == state)
+ if (v->state == state)
return;
br_vlan_set_state(v, state);
@@ -100,12 +100,11 @@ int br_mst_set_state(struct net_bridge_port *p, u16 msti, u8 state,
};
struct net_bridge_vlan_group *vg;
struct net_bridge_vlan *v;
- int err = 0;
+ int err;
- rcu_read_lock();
vg = nbp_vlan_group(p);
if (!vg)
- goto out;
+ return 0;
/* MSTI 0 (CST) state changes are notified via the regular
* SWITCHDEV_ATTR_ID_PORT_STP_STATE.
@@ -113,20 +112,17 @@ int br_mst_set_state(struct net_bridge_port *p, u16 msti, u8 state,
if (msti) {
err = switchdev_port_attr_set(p->dev, &attr, extack);
if (err && err != -EOPNOTSUPP)
- goto out;
+ return err;
}
- err = 0;
- list_for_each_entry_rcu(v, &vg->vlan_list, vlist) {
+ list_for_each_entry(v, &vg->vlan_list, vlist) {
if (v->brvlan->msti != msti)
continue;
br_mst_vlan_set_state(p, v, state);
}
-out:
- rcu_read_unlock();
- return err;
+ return 0;
}
static void br_mst_vlan_sync_state(struct net_bridge_vlan *pv, u16 msti)