summaryrefslogtreecommitdiff
path: root/drivers/net/team/team_mode_activebackup.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-06-20 12:39:39 +0400
committerDavid S. Miller <davem@davemloft.net>2012-06-21 01:29:12 +0400
commit6dab015cf8c9d2fabb13d0332998bc440e9c6555 (patch)
tree654ae3c37f5fe1a37677745204227b1152ab0965 /drivers/net/team/team_mode_activebackup.c
parentf643776e4d1906ceff59f18315d6aba8e85db343 (diff)
downloadlinux-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.c8
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;