[PATCH net] net: llc: make empty have static storage duration

From: Wentao Guan

Date: Tue Jun 16 2026 - 02:41:44 EST


Make empty have static storage duration (like net/sysctl_net.c does) to
avoid a potential use-after-return and keep consistent with
__register_sysctl_table @table 'should not be free'd after registration'.

Fixes: 73dbd8cf7947 ("net: Remove ctl_table sentinel elements from several networking subsystems")
Signed-off-by: Wentao Guan <guanwentao@xxxxxxxxxxxxx>
---
net/llc/sysctl_net_llc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index c8d88e2508fce..15f1e5d88f208 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -47,7 +47,7 @@ static struct ctl_table_header *llc_station_header;

int __init llc_sysctl_init(void)
{
- struct ctl_table empty[1] = {};
+ static struct ctl_table empty[1] = {};
llc2_timeout_header = register_net_sysctl(&init_net, "net/llc/llc2/timeout", llc2_timeout_table);
llc_station_header = register_net_sysctl_sz(&init_net, "net/llc/station", empty, 0);

--
2.30.2