Validate supplied priority group count.
--- diff/drivers/md/dm-mpath.c	2004-11-10 15:12:17.000000000 +0000
+++ source/drivers/md/dm-mpath.c	2004-11-10 15:12:24.000000000 +0000
@@ -624,6 +624,7 @@
 	int r;
 	struct multipath *m;
 	struct arg_set as;
+	unsigned pg_count = 0;
 
 	as.argc = argc;
 	as.argv = argv;
@@ -657,6 +658,13 @@
 
 		m->nr_valid_paths += pg->nr_paths;
 		list_add_tail(&pg->list, &m->priority_groups);
+		pg_count++;
+	}
+
+	if (pg_count != m->nr_priority_groups) {
+		ti->error = ESTR("priority group count mismatch");
+		r = -EINVAL;
+		goto bad;
 	}
 
 	ti->private = m;
