--- linux-last/drivers/md/dm-table.c	Wed Nov 14 14:42:24 2001
+++ linux/drivers/md/dm-table.c	Wed Nov 14 17:48:28 2001
@@ -91,6 +91,7 @@
 		memcpy(n_targets, t->targets, sizeof(*n_targets) * n);
 	}
 
+	memset(n_highs + n , -1, sizeof(*n_highs) * (num - n));
 	vfree(t->highs);
 
 	t->num_allocated = num;
@@ -376,7 +377,8 @@
 
 	/* set up internal nodes, bottom-up */
 	for (i = t->depth - 2, total = 0; i >= 0; i--) {
-		t->index[i] = indexes + (KEYS_PER_NODE * t->counts[i]);
+		t->index[i] = indexes;
+		indexes += (KEYS_PER_NODE * t->counts[i]);
 		setup_btree_index(i, t);
 	}
 
