ipv4: fib: Allocate fib_info_hash[] and fib_info_laddrhash[] by kvcalloc().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 28 Feb 2025 04:23:18 +0000 (20:23 -0800)
committerJakub Kicinski <kuba@kernel.org>
Mon, 3 Mar 2025 23:04:09 +0000 (15:04 -0800)
commitfa336adc100e1d76a50da782c3e9abb1541a72f3
tree1db590f13d0a1ffbc3d7dd0c22be687d295e49c3
parente5bf1c39e894d754092ff55b06035ed222a359ec
ipv4: fib: Allocate fib_info_hash[] and fib_info_laddrhash[] by kvcalloc().

Both fib_info_hash[] and fib_info_laddrhash[] are hash tables for
struct fib_info and are allocated by kvzmalloc() separately.

Let's replace the two kvzmalloc() calls with kvcalloc() to remove
the fib_info_laddrhash pointer later.

Note that fib_info_hash_alloc() allocates a new hash table based on
fib_info_hash_bits because we will remove fib_info_hash_size later.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250228042328.96624-3-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/fib_semantics.c