summaryrefslogtreecommitdiff
path: root/drivers/net/team/team_mode_activebackup.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-06-20 05:32:00 +0000
committerDavid S. Miller <davem@davemloft.net>2012-06-20 14:04:10 -0700
commitb443a2307d3ade1520daa15d79ef97ad00641504 (patch)
tree28a35122ade392cc700a6fec361f7bf8b45f88c1 /drivers/net/team/team_mode_activebackup.c
parent1aa2d1daf067c8c9e625449e2e6f54caa3e34023 (diff)
team: use rcu_access_pointer to access RCU pointer by writer
Signed-off-by: Jiri Pirko <jpirko@redhat.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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c
index 2fe02a8713ea..c9e7621b4480 100644
--- a/drivers/net/team/team_mode_activebackup.c
+++ b/drivers/net/team/team_mode_activebackup.c
@@ -61,8 +61,11 @@ 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_access_pointer(ab_priv(team)->active_port);
+ if (active_port)
+ ctx->data.u32_val = active_port->dev->ifindex;
else
ctx->data.u32_val = 0;
return 0;