diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-06-10 19:42:25 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-06-12 14:06:16 +0400 |
commit | 735d381fa57c573935d35a24ea271ec99897ac63 (patch) | |
tree | e1118f79060396214ac150339eaa6a3a1c7c2168 /drivers/net/team/team_mode_roundrobin.c | |
parent | d80b35beac78b52faad2359adf6a6b14e2725e51 (diff) | |
download | linux-735d381fa57c573935d35a24ea271ec99897ac63.tar.xz |
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.c | 3 |
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)) |