--- a/drivers/md/dm-table.c	1 Oct 2003 21:48:54 -0000
+++ b/drivers/md/dm-table.c	24 Oct 2003 17:20:08 -0000
@@ -162,6 +162,8 @@
 	if (!num_targets)
 		num_targets = KEYS_PER_NODE;
 
+	num_targets = dm_round_up(num_targets, KEYS_PER_NODE);
+
 	if (alloc_targets(t, num_targets)) {
 		kfree(t);
 		t = NULL;
