Skip to content

Commit

Permalink
datapath: Use with RCU_INIT_POINTER(x, NULL) in vport-gre.c
Browse files Browse the repository at this point in the history
This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
  • Loading branch information
MonamAgarwal authored and jessegross committed Mar 28, 2014
1 parent 5794e27 commit 317e49b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion datapath/vport-gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static void gre_tnl_destroy(struct vport *vport)

ovs_net = net_generic(net, ovs_net_id);

rcu_assign_pointer(ovs_net->vport_net.gre_vport, NULL);
RCU_INIT_POINTER(ovs_net->vport_net.gre_vport, NULL);
ovs_vport_deferred_free(vport);
gre_exit();
}
Expand Down

0 comments on commit 317e49b

Please sign in to comment.