Validate supplied priority group count. --- diff/drivers/md/dm-mpath.c 2005-01-12 19:14:11.000000000 +0000 +++ source/drivers/md/dm-mpath.c 2005-01-12 19:14:21.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;