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

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
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
}