Skip to content
Commit 02618095 authored by Miaohe Lin's avatar Miaohe Lin Committed by Greg Kroah-Hartman
Browse files

net: Fix potential memory leak in proto_register()



[ Upstream commit 0f5907af ]

If we failed to assign proto idx, we free the twsk_slab_name but forget to
free the twsk_slab. Add a helper function tw_prot_cleanup() to free these
together and also use this helper function in proto_unregister().

Fixes: b45ce321 ("sock: fix potential memory leak in proto_register()")
Signed-off-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6c5d9f3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment