diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-06-20 12:39:39 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-21 01:29:12 +0400 |
commit | 6dab015cf8c9d2fabb13d0332998bc440e9c6555 (patch) | |
tree | 654ae3c37f5fe1a37677745204227b1152ab0965 /drivers/net/team/team_mode_activebackup.c | |
parent | f643776e4d1906ceff59f18315d6aba8e85db343 (diff) | |
download | linux-6dab015cf8c9d2fabb13d0332998bc440e9c6555.tar.xz |
team: do RCU update path fixups
Use rcu_access_pointer and rcu_dereference_protected
to access RCU pointer by updater.
Use RCU_INIT_POINTER for NULL assignment of RCU pointer.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team/team_mode_activebackup.c')
-rw-r--r-- | drivers/net/team/team_mode_activebackup.c | 8 |
1 files changed, 6 insertions, 2 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) static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) { - if (ab_priv(team)->active_port) - ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex; + struct team_port *active_port; + + active_port = rcu_dereference_protected(ab_priv(team)->active_port, + lockdep_is_held(&team->lock)); + if (active_port) + ctx->data.u32_val = active_port->dev->ifindex; else ctx->data.u32_val = 0; return 0; |