Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sock: remove the unnecessary check in proto_register

tw_prot_cleanup will check the twsk_prot.

Fixes: 0f5907af3913 ("net: Fix potential memory leak in proto_register()")
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Tonghao Zhang and committed by
David S. Miller
ed744d81 cad4162a

+1 -1
+1 -1
net/core/sock.c
··· 3531 3531 return ret; 3532 3532 3533 3533 out_free_timewait_sock_slab: 3534 - if (alloc_slab && prot->twsk_prot) 3534 + if (alloc_slab) 3535 3535 tw_prot_cleanup(prot->twsk_prot); 3536 3536 out_free_request_sock_slab: 3537 3537 if (alloc_slab) {