Commit ea41b880 authored by Nikolay Aleksandrov's avatar Nikolay Aleksandrov Committed by Daniel Borkmann

netkit: Remove explicit active/peer ptr initialization

Remove the explicit NULLing of active/peer pointers and rely on the
implicit one done at net device allocation.
Suggested-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarNikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20231026094106.1505892-2-razor@blackwall.org
parent 399f6185
...@@ -371,8 +371,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev, ...@@ -371,8 +371,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev,
nk->policy = default_peer; nk->policy = default_peer;
nk->mode = mode; nk->mode = mode;
bpf_mprog_bundle_init(&nk->bundle); bpf_mprog_bundle_init(&nk->bundle);
RCU_INIT_POINTER(nk->active, NULL);
RCU_INIT_POINTER(nk->peer, NULL);
err = register_netdevice(peer); err = register_netdevice(peer);
put_net(net); put_net(net);
...@@ -398,8 +396,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev, ...@@ -398,8 +396,6 @@ static int netkit_new_link(struct net *src_net, struct net_device *dev,
nk->policy = default_prim; nk->policy = default_prim;
nk->mode = mode; nk->mode = mode;
bpf_mprog_bundle_init(&nk->bundle); bpf_mprog_bundle_init(&nk->bundle);
RCU_INIT_POINTER(nk->active, NULL);
RCU_INIT_POINTER(nk->peer, NULL);
err = register_netdevice(dev); err = register_netdevice(dev);
if (err < 0) if (err < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment