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

Configure Feed

Select the types of activity you want to include in your feed.

netlink: Remove the dead code in netlink_proto_init()

In the error path of netlink_proto_init(), frees the already allocated
bucket table for new hash tables in a loop, but it is going to panic,
so it is not necessary to clean up the resources, just remove the
dead code.

Suggested-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://patch.msgid.link/20241030012147.357400-1-ruanjinjie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jinjie Ruan and committed by
Jakub Kicinski
bc74d329 d3774a4b

+1 -5
+1 -5
net/netlink/af_netlink.c
··· 2935 2935 2936 2936 for (i = 0; i < MAX_LINKS; i++) { 2937 2937 if (rhashtable_init(&nl_table[i].hash, 2938 - &netlink_rhashtable_params) < 0) { 2939 - while (--i > 0) 2940 - rhashtable_destroy(&nl_table[i].hash); 2941 - kfree(nl_table); 2938 + &netlink_rhashtable_params) < 0) 2942 2939 goto panic; 2943 - } 2944 2940 } 2945 2941 2946 2942 netlink_add_usersock_entry();