Skip to content

Commit

Permalink
netkit: Remove explicit active/peer ptr initialization
Browse files Browse the repository at this point in the history
Remove the explicit NULLing of active/peer pointers and rely on the
implicit one done at net device allocation.

Suggested-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20231026094106.1505892-2-razor@blackwall.org
  • Loading branch information
Nikolay Aleksandrov authored and Daniel Borkmann committed Oct 26, 2023
1 parent 399f618 commit ea41b88
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/net/netkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev,
nk->policy = default_peer;
nk->mode = mode;
bpf_mprog_bundle_init(&nk->bundle);
RCU_INIT_POINTER(nk->active, NULL);
RCU_INIT_POINTER(nk->peer, NULL);

err = register_netdevice(peer);
put_net(net);
Expand All @@ -398,8 +396,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev,
nk->policy = default_prim;
nk->mode = mode;
bpf_mprog_bundle_init(&nk->bundle);
RCU_INIT_POINTER(nk->active, NULL);
RCU_INIT_POINTER(nk->peer, NULL);

err = register_netdevice(dev);
if (err < 0)
Expand Down

0 comments on commit ea41b88

Please sign in to comment.