Commit ed744d81 authored by Tonghao Zhang's avatar Tonghao Zhang Committed by David S. Miller

net: sock: remove the unnecessary check in proto_register

tw_prot_cleanup will check the twsk_prot.

Fixes: 0f5907af ("net: Fix potential memory leak in proto_register()")
Cc: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cad4162a
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment