aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
authorWentao Guan <guanwentao@uniontech.com>2026-06-16 14:40:53 +0800
committerJakub Kicinski <kuba@kernel.org>2026-06-18 17:52:56 -0700
commitd31deeab707b7945a7805d6406d0cd3118e640ef (patch)
tree7c8dd7702921625a3c4d7d0f67bd4bc75f60ea21 /net
parented2294f94e34e97342850c40b320833d881c3819 (diff)
downloadath-d31deeab707b7945a7805d6406d0cd3118e640ef.tar.gz
net: llc: make empty have static storage duration
Make @empty have static storage duration (like net/sysctl_net.c does) to avoid storing a bad pointer, and keep consistent with __register_sysctl_table @table 'should not be free'd after registration'. Note that this is _not_ a bug, since size is 0 the pointer will never get deferenced. Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20260616064053.690154-1-guanwentao@uniontech.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/llc/sysctl_net_llc.c2
1 files changed, 1 insertions, 1 deletions
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);