netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR
authorFlorian Westphal <fw@strlen.de>
Tue, 13 Feb 2024 15:23:38 +0000 (16:23 +0100)
committerFlorian Westphal <fw@strlen.de>
Wed, 21 Feb 2024 10:57:11 +0000 (11:57 +0100)
commit07ace0bbe03b3d8e85869af1dec5e4087b1d57b8
treee3daeef43b443a27e206bf3ba6bc0418edb33ffc
parentf04df573faf90bb828a2241b650598c02c074323
netfilter: nft_set_pipapo: do not rely on ZERO_SIZE_PTR

pipapo relies on kmalloc(0) returning ZERO_SIZE_PTR (i.e., not NULL
but pointer is invalid).

Rework this to not call slab allocator when we'd request a 0-byte
allocation.

Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
net/netfilter/nft_set_pipapo.c