aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r--drivers/md/dm-raid.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 777d9ba2acad..88e4c7f24986 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -1237,7 +1237,7 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
1237 argv++; 1237 argv++;
1238 1238
1239 /* Skip over RAID params for now and find out # of devices */ 1239 /* Skip over RAID params for now and find out # of devices */
1240 if (num_raid_params + 1 > argc) { 1240 if (num_raid_params >= argc) {
1241 ti->error = "Arguments do not agree with counts given"; 1241 ti->error = "Arguments do not agree with counts given";
1242 return -EINVAL; 1242 return -EINVAL;
1243 } 1243 }
@@ -1248,6 +1248,12 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
1248 return -EINVAL; 1248 return -EINVAL;
1249 } 1249 }
1250 1250
1251 argc -= num_raid_params + 1; /* +1: we already have num_raid_devs */
1252 if (argc != (num_raid_devs * 2)) {
1253 ti->error = "Supplied RAID devices does not match the count given";
1254 return -EINVAL;
1255 }
1256
1251 rs = context_alloc(ti, rt, (unsigned)num_raid_devs); 1257 rs = context_alloc(ti, rt, (unsigned)num_raid_devs);
1252 if (IS_ERR(rs)) 1258 if (IS_ERR(rs))
1253 return PTR_ERR(rs); 1259 return PTR_ERR(rs);
@@ -1256,16 +1262,8 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv)
1256 if (ret) 1262 if (ret)
1257 goto bad; 1263 goto bad;
1258 1264
1259 ret = -EINVAL;
1260
1261 argc -= num_raid_params + 1; /* +1: we already have num_raid_devs */
1262 argv += num_raid_params + 1; 1265 argv += num_raid_params + 1;
1263 1266
1264 if (argc != (num_raid_devs * 2)) {
1265 ti->error = "Supplied RAID devices does not match the count given";
1266 goto bad;
1267 }
1268
1269 ret = dev_parms(rs, argv); 1267 ret = dev_parms(rs, argv);
1270 if (ret) 1268 if (ret)
1271 goto bad; 1269 goto bad;