summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorTonghao Zhang <xiangxia.m.yue@gmail.com>2021-04-22 16:41:51 +0300
committerDavid S. Miller <davem@davemloft.net>2021-04-23 23:10:03 +0300
commited744d819379ddeec5744b0bfc7eb6d0a8ac4e46 (patch)
treeb90dd243db1b23d99371f9d9238d9dc9c62c52f7 /net
parentcad4162a90aeff737a16c0286987f51e927f003a (diff)
downloadlinux-ed744d819379ddeec5744b0bfc7eb6d0a8ac4e46.tar.xz
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>
Diffstat (limited to 'net')
-rw-r--r--net/core/sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/sock.c b/net/core/sock.c
index 5ec90f99e102..c761c4a0b66b 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3531,7 +3531,7 @@ int proto_register(struct proto *prot, int alloc_slab)
return ret;
out_free_timewait_sock_slab:
- if (alloc_slab && prot->twsk_prot)
+ if (alloc_slab)
tw_prot_cleanup(prot->twsk_prot);
out_free_request_sock_slab:
if (alloc_slab) {