Skip to content

Commit

Permalink
vxlan: use a more suitable function when assigning NULL
Browse files Browse the repository at this point in the history
When stopping the vxlan interface we detach it from the socket.
Use RCU_INIT_POINTER() and not rcu_assign_pointer() to do so.

Suggested-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Mark Bloch <markb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Mark Bloch authored and David S. Miller committed Jun 7, 2017
1 parent 1dec4ce commit 57d8818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,10 +1077,10 @@ static void vxlan_sock_release(struct vxlan_dev *vxlan)
#if IS_ENABLED(CONFIG_IPV6)
struct vxlan_sock *sock6 = rtnl_dereference(vxlan->vn6_sock);

rcu_assign_pointer(vxlan->vn6_sock, NULL);
RCU_INIT_POINTER(vxlan->vn6_sock, NULL);
#endif

rcu_assign_pointer(vxlan->vn4_sock, NULL);
RCU_INIT_POINTER(vxlan->vn4_sock, NULL);
synchronize_net();

vxlan_vs_del_dev(vxlan);
Expand Down

0 comments on commit 57d8818

Please sign in to comment.