From: Sebastian Andrzej Siewior Date: Fri, 28 Jun 2024 10:18:54 +0000 (+0200) Subject: net: Remove task_struct::bpf_net_context init on fork. X-Git-Tag: v6.11-rc1~163^2~105^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2896624be30b049601ec3ef9b08df184d0c70495;p=thirdparty%2Fkernel%2Flinux.git net: Remove task_struct::bpf_net_context init on fork. 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 Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Jakub Kicinski Signed-off-by: Paolo Abeni --- diff --git a/kernel/fork.c b/kernel/fork.c index f314bdd7e6108..99076dbe27d83 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -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);