diff options
Diffstat (limited to 'drivers/net/team')
-rw-r--r-- | drivers/net/team/team_mode_activebackup.c | 8 | ||||
-rw-r--r-- | drivers/net/team/team_mode_loadbalance.c | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c index 2fe02a8713ea..253b8a5f3427 100644 --- a/drivers/net/team/team_mode_activebackup.c +++ b/drivers/net/team/team_mode_activebackup.c | |||
@@ -61,8 +61,12 @@ static void ab_port_leave(struct team *team, struct team_port *port) | |||
61 | 61 | ||
62 | static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) | 62 | static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) |
63 | { | 63 | { |
64 | if (ab_priv(team)->active_port) | 64 | struct team_port *active_port; |
65 | ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex; | 65 | |
66 | active_port = rcu_dereference_protected(ab_priv(team)->active_port, | ||
67 | lockdep_is_held(&team->lock)); | ||
68 | if (active_port) | ||
69 | ctx->data.u32_val = active_port->dev->ifindex; | ||
66 | else | 70 | else |
67 | ctx->data.u32_val = 0; | 71 | ctx->data.u32_val = 0; |
68 | return 0; | 72 | return 0; |
diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c index 45cc0951aa48..c92fa02d6a63 100644 --- a/drivers/net/team/team_mode_loadbalance.c +++ b/drivers/net/team/team_mode_loadbalance.c | |||
@@ -96,8 +96,8 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team, | |||
96 | struct lb_port_mapping *pm; | 96 | struct lb_port_mapping *pm; |
97 | 97 | ||
98 | pm = &lb_priv->ex->tx_hash_to_port_mapping[i]; | 98 | pm = &lb_priv->ex->tx_hash_to_port_mapping[i]; |
99 | if (pm->port == port) { | 99 | if (rcu_access_pointer(pm->port) == port) { |
100 | rcu_assign_pointer(pm->port, NULL); | 100 | RCU_INIT_POINTER(pm->port, NULL); |
101 | team_option_inst_set_change(pm->opt_inst_info); | 101 | team_option_inst_set_change(pm->opt_inst_info); |
102 | changed = true; | 102 | changed = true; |
103 | } | 103 | } |
@@ -274,6 +274,7 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx) | |||
274 | { | 274 | { |
275 | struct lb_priv *lb_priv = get_lb_priv(team); | 275 | struct lb_priv *lb_priv = get_lb_priv(team); |
276 | struct sk_filter *fp = NULL; | 276 | struct sk_filter *fp = NULL; |
277 | struct sk_filter *orig_fp; | ||
277 | struct sock_fprog *fprog = NULL; | 278 | struct sock_fprog *fprog = NULL; |
278 | int err; | 279 | int err; |
279 | 280 | ||
@@ -292,7 +293,9 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx) | |||
292 | if (lb_priv->ex->orig_fprog) { | 293 | if (lb_priv->ex->orig_fprog) { |
293 | /* Clear old filter data */ | 294 | /* Clear old filter data */ |
294 | __fprog_destroy(lb_priv->ex->orig_fprog); | 295 | __fprog_destroy(lb_priv->ex->orig_fprog); |
295 | sk_unattached_filter_destroy(lb_priv->fp); | 296 | orig_fp = rcu_dereference_protected(lb_priv->fp, |
297 | lockdep_is_held(&team->lock)); | ||
298 | sk_unattached_filter_destroy(orig_fp); | ||
296 | } | 299 | } |
297 | 300 | ||
298 | rcu_assign_pointer(lb_priv->fp, fp); | 301 | rcu_assign_pointer(lb_priv->fp, fp); |
@@ -303,9 +306,12 @@ static int lb_bpf_func_set(struct team *team, struct team_gsetter_ctx *ctx) | |||
303 | static int lb_tx_method_get(struct team *team, struct team_gsetter_ctx *ctx) | 306 | static int lb_tx_method_get(struct team *team, struct team_gsetter_ctx *ctx) |
304 | { | 307 | { |
305 | struct lb_priv *lb_priv = get_lb_priv(team); | 308 | struct lb_priv *lb_priv = get_lb_priv(team); |
309 | lb_select_tx_port_func_t *func; | ||
306 | char *name; | 310 | char *name; |
307 | 311 | ||
308 | name = lb_select_tx_port_get_name(lb_priv->select_tx_port_func); | 312 | func = rcu_dereference_protected(lb_priv->select_tx_port_func, |
313 | lockdep_is_held(&team->lock)); | ||
314 | name = lb_select_tx_port_get_name(func); | ||
309 | BUG_ON(!name); | 315 | BUG_ON(!name); |
310 | ctx->data.str_val = name; | 316 | ctx->data.str_val = name; |
311 | return 0; | 317 | return 0; |