]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
dccp Remove inet_hashinfo2_init_mod().
authorKuniyuki Iwashima <kuniyu@google.com>
Sun, 1 Mar 2026 06:37:55 +0000 (06:37 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2026 02:50:28 +0000 (18:50 -0800)
Commit c92c81df93df ("net: dccp: fix kernel crash on module load")
added inet_hashinfo2_init_mod() for DCCP.

Commit 22d6c9eebf2e ("net: Unexport shared functions for DCCP.")
removed EXPORT_SYMBOL_GPL() it but forgot to remove the function
itself.

Let's remove inet_hashinfo2_init_mod().

Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260301063756.1581685-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/inet_hashtables.h
net/ipv4/inet_hashtables.c

index ac05a52d9e1382cd7ed88ff07eab67ec42a2ede0..8bddf58b1a85145c3a8e9fe289318aed080d8c1e 100644 (file)
@@ -286,7 +286,6 @@ void inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
                         unsigned long numentries, int scale,
                         unsigned long low_limit,
                         unsigned long high_limit);
-int inet_hashinfo2_init_mod(struct inet_hashinfo *h);
 
 bool inet_ehash_insert(struct sock *sk, struct sock *osk, bool *found_dup_sk);
 bool inet_ehash_nolisten(struct sock *sk, struct sock *osk,
index fca980772c81c785b086d5e8fa1dc44cd8c01591..52847950b28a71b6673c5313d1fbbe59f7a74230 100644 (file)
@@ -1246,22 +1246,13 @@ int inet_hash_connect(struct inet_timewait_death_row *death_row,
                                   __inet_check_established);
 }
 
-static void init_hashinfo_lhash2(struct inet_hashinfo *h)
-{
-       int i;
-
-       for (i = 0; i <= h->lhash2_mask; i++) {
-               spin_lock_init(&h->lhash2[i].lock);
-               INIT_HLIST_NULLS_HEAD(&h->lhash2[i].nulls_head,
-                                     i + LISTENING_NULLS_BASE);
-       }
-}
-
 void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
                                unsigned long numentries, int scale,
                                unsigned long low_limit,
                                unsigned long high_limit)
 {
+       unsigned int i;
+
        h->lhash2 = alloc_large_system_hash(name,
                                            sizeof(*h->lhash2),
                                            numentries,
@@ -1271,7 +1262,12 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
                                            &h->lhash2_mask,
                                            low_limit,
                                            high_limit);
-       init_hashinfo_lhash2(h);
+
+       for (i = 0; i <= h->lhash2_mask; i++) {
+               spin_lock_init(&h->lhash2[i].lock);
+               INIT_HLIST_NULLS_HEAD(&h->lhash2[i].nulls_head,
+                                     i + LISTENING_NULLS_BASE);
+       }
 
        /* this one is used for source ports of outgoing connections */
        table_perturb = alloc_large_system_hash("Table-perturb",
@@ -1282,20 +1278,6 @@ void __init inet_hashinfo2_init(struct inet_hashinfo *h, const char *name,
                                                INET_TABLE_PERTURB_SIZE);
 }
 
-int inet_hashinfo2_init_mod(struct inet_hashinfo *h)
-{
-       h->lhash2 = kmalloc_objs(*h->lhash2, INET_LHTABLE_SIZE);
-       if (!h->lhash2)
-               return -ENOMEM;
-
-       h->lhash2_mask = INET_LHTABLE_SIZE - 1;
-       /* INET_LHTABLE_SIZE must be a power of 2 */
-       BUG_ON(INET_LHTABLE_SIZE & h->lhash2_mask);
-
-       init_hashinfo_lhash2(h);
-       return 0;
-}
-
 int inet_ehash_locks_alloc(struct inet_hashinfo *hashinfo)
 {
        unsigned int locksz = sizeof(spinlock_t);