Commit 5787db7c authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Pablo Neira Ayuso

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarJulian Anastasov <ja@ssi.bg>
Acked-by: default avatarSimon Horman <horms@verge.net.au>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 9d2f00fb
...@@ -174,8 +174,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s, ...@@ -174,8 +174,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s,
return 0; return 0;
} }
table = kcalloc(BITS_TO_LONGS(IP_VS_MH_TAB_SIZE), table = bitmap_zalloc(IP_VS_MH_TAB_SIZE, GFP_KERNEL);
sizeof(unsigned long), GFP_KERNEL);
if (!table) if (!table)
return -ENOMEM; return -ENOMEM;
...@@ -227,7 +226,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s, ...@@ -227,7 +226,7 @@ static int ip_vs_mh_populate(struct ip_vs_mh_state *s,
} }
out: out:
kfree(table); bitmap_free(table);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment