summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2015-03-04 08:36:31 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-18 13:31:23 +0100
commit67b58fb7d3e7b1e393609e14d95d02a14d7328db (patch)
tree166c31d5b1d81c36ad462b12072984e98c0b5c4f
parentf15e90f9f297c4c2c22de0f5b8530cb9fe62f263 (diff)
team: don't traverse port list using rcu in team_set_mac_address
[ Upstream commit 9215f437b85da339a7dfe3db6e288637406f88b2 ] Currently the list is traversed using rcu variant. That is not correct since dev_set_mac_address can be called which eventually calls rtmsg_ifinfo_build_skb and there, skb allocation can sleep. So fix this by remove the rcu usage here. Fixes: 3d249d4ca7 "net: introduce ethernet teaming device" Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/net/team/team.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 5d43a7b5fa02..c28e2dafb3f0 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1723,11 +1723,11 @@ static int team_set_mac_address(struct net_device *dev, void *p)
if (dev->type == ARPHRD_ETHER && !is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
- rcu_read_lock();
- list_for_each_entry_rcu(port, &team->port_list, list)
+ mutex_lock(&team->lock);
+ list_for_each_entry(port, &team->port_list, list)
if (team->ops.port_change_dev_addr)
team->ops.port_change_dev_addr(team, port);
- rcu_read_unlock();
+ mutex_unlock(&team->lock);
return 0;
}