summaryrefslogtreecommitdiffstats
path: root/drivers/net/team/team_mode_roundrobin.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-06-10 17:42:25 +0200
committerDavid S. Miller <davem@davemloft.net>2013-06-12 12:06:16 +0200
commit735d381fa57c573935d35a24ea271ec99897ac63 (patch)
treee1118f79060396214ac150339eaa6a3a1c7c2168 /drivers/net/team/team_mode_roundrobin.c
parentteam: use kfree_rcu instead of synchronize_rcu in team_port_dev (diff)
downloadlinux-735d381fa57c573935d35a24ea271ec99897ac63.tar.xz
linux-735d381fa57c573935d35a24ea271ec99897ac63.zip
team: remove synchronize_rcu() called during port disable
Check the unlikely case of team->en_port_count == 0 before modulo operation. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team/team_mode_roundrobin.c')
-rw-r--r--drivers/net/team/team_mode_roundrobin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/team/team_mode_roundrobin.c b/drivers/net/team/team_mode_roundrobin.c
index d268e4de781b..90311c7375fb 100644
--- a/drivers/net/team/team_mode_roundrobin.c
+++ b/drivers/net/team/team_mode_roundrobin.c
@@ -30,7 +30,8 @@ static bool rr_transmit(struct team *team, struct sk_buff *skb)
struct team_port *port;
int port_index;
- port_index = rr_priv(team)->sent_packets++ % team->en_port_count;
+ port_index = team_num_to_port_index(team,
+ rr_priv(team)->sent_packets++);
port = team_get_port_by_index_rcu(team, port_index);
port = team_get_first_port_txable_rcu(team, port);
if (unlikely(!port))