mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
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>
This commit is contained in:
parent
d80b35beac
commit
735d381fa5
4 changed files with 18 additions and 18 deletions
|
|
@ -229,6 +229,16 @@ static inline struct team_port *team_get_port_by_index(struct team *team,
|
|||
return port;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline int team_num_to_port_index(struct team *team, int num)
|
||||
{
|
||||
int en_port_count = ACCESS_ONCE(team->en_port_count);
|
||||
|
||||
if (unlikely(!en_port_count))
|
||||
return 0;
|
||||
return num % en_port_count;
|
||||
}
|
||||
|
||||
static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
|
||||
int port_index)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue