diff options
author | 2022-07-04 21:24:46 +0200 | |
---|---|---|
committer | 2022-07-21 00:55:39 +0200 | |
commit | 5787db7c905323cb303a7c39d15fb2067e948adf (patch) | |
tree | e1549ba7c6a726ad39beb288d31cd08cec5e8646 | |
parent | netfilter: nf_nat: in nf_nat_initialized(), use const struct nf_conn * (diff) | |
download | linux-dev-5787db7c905323cb303a7c39d15fb2067e948adf.tar.xz linux-dev-5787db7c905323cb303a7c39d15fb2067e948adf.zip |
netfilter: ipvs: Use the bitmap API to allocate bitmaps
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.
It is less verbose and it improves the semantic.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/ipvs/ip_vs_mh.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/netfilter/ipvs/ip_vs_mh.c b/net/netfilter/ipvs/ip_vs_mh.c index da0280cec506..e3d7f5c879ce 100644 --- a/net/netfilter/ipvs/ip_vs_mh.c +++ b/net/netfilter/ipvs/ip_vs_mh.c @@ -174,8 +174,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s, return 0; } - table = kcalloc(BITS_TO_LONGS(IP_VS_MH_TAB_SIZE), - sizeof(unsigned long), GFP_KERNEL); + table = bitmap_zalloc(IP_VS_MH_TAB_SIZE, GFP_KERNEL); if (!table) return -ENOMEM; @@ -227,7 +226,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s, } out: - kfree(table); + bitmap_free(table); return 0; } |