From: Tonghao Zhang <redacted>
Introduce the new function tw_prot_init (inspired by
req_prot_init) to simplify "proto_register" function.
tw_prot_cleanup will take care of a partially initialized
timewait_sock_ops.
Signed-off-by: Tonghao Zhang <redacted>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
---
net/core/sock.c | 44 ++++++++++++++++++++++++++++----------------
1 file changed, 28 insertions(+), 16 deletions(-)
@@ -3496,22 +3522,8 @@ int proto_register(struct proto *prot, int alloc_slab)if(req_prot_init(prot))gotoout_free_request_sock_slab;-if(prot->twsk_prot!=NULL){-prot->twsk_prot->twsk_slab_name=kasprintf(GFP_KERNEL,"tw_sock_%s",prot->name);--if(prot->twsk_prot->twsk_slab_name==NULL)-gotoout_free_request_sock_slab;--prot->twsk_prot->twsk_slab=-kmem_cache_create(prot->twsk_prot->twsk_slab_name,-prot->twsk_prot->twsk_obj_size,-0,-SLAB_ACCOUNT|-prot->slab_flags,-NULL);-if(prot->twsk_prot->twsk_slab==NULL)-gotoout_free_timewait_sock_slab;-}+if(tw_prot_init(prot))+gotoout_free_timewait_sock_slab;}mutex_lock(&proto_list_mutex);
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 11 Mar 2021 10:57:36 +0800 you wrote:
From: Tonghao Zhang <redacted>
Introduce the new function tw_prot_init (inspired by
req_prot_init) to simplify "proto_register" function.
tw_prot_cleanup will take care of a partially initialized
timewait_sock_ops.
[...]
From: Eric Dumazet <hidden> Date: 2021-03-12 14:16:50
On 3/12/21 1:10 AM, patchwork-bot+netdevbpf@kernel.org wrote:
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 11 Mar 2021 10:57:36 +0800 you wrote:
quoted
From: Tonghao Zhang <redacted>
Introduce the new function tw_prot_init (inspired by
req_prot_init) to simplify "proto_register" function.
tw_prot_cleanup will take care of a partially initialized
timewait_sock_ops.
[...]
On Fri, Mar 12, 2021 at 10:15 PM Eric Dumazet [off-list ref] wrote:
On 3/12/21 1:10 AM, patchwork-bot+netdevbpf@kernel.org wrote:
quoted
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Thu, 11 Mar 2021 10:57:36 +0800 you wrote:
quoted
From: Tonghao Zhang <redacted>
Introduce the new function tw_prot_init (inspired by
req_prot_init) to simplify "proto_register" function.
tw_prot_cleanup will take care of a partially initialized
timewait_sock_ops.
[...]