]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: Remove task_struct::bpf_net_context init on fork.
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 28 Jun 2024 10:18:54 +0000 (12:18 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 2 Jul 2024 13:26:57 +0000 (15:26 +0200)
There is no clone() invocation within a bpf_net_ctx_…() block. Therefore
the task_struct::bpf_net_context has always to be NULL and an explicit
initialisation is not required.

Remove the NULL assignment in the clone() path.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
kernel/fork.c

index f314bdd7e6108abff0c5c174bf19926f2ebee04c..99076dbe27d83f93d704882d4f5c09ae103af303 100644 (file)
@@ -2355,7 +2355,6 @@ __latent_entropy struct task_struct *copy_process(
        RCU_INIT_POINTER(p->bpf_storage, NULL);
        p->bpf_ctx = NULL;
 #endif
-       p->bpf_net_context =  NULL;
 
        /* Perform scheduler related setup. Assign this task to a CPU. */
        retval = sched_fork(clone_flags, p);