diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-06-20 09:32:00 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-21 01:04:10 +0400 |
commit | b443a2307d3ade1520daa15d79ef97ad00641504 (patch) | |
tree | 28a35122ade392cc700a6fec361f7bf8b45f88c1 /drivers/net/team/team_mode_activebackup.c | |
parent | 1aa2d1daf067c8c9e625449e2e6f54caa3e34023 (diff) | |
download | linux-b443a2307d3ade1520daa15d79ef97ad00641504.tar.xz |
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.c | 7 |
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; |