diff options
-rw-r--r-- | drivers/md/dm-mpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d234b6c33646..f8369697af12 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -1364,7 +1364,7 @@ static int switch_pg_num(struct multipath *m, const char *pgstr) | |||
1364 | char dummy; | 1364 | char dummy; |
1365 | 1365 | ||
1366 | if (!pgstr || (sscanf(pgstr, "%u%c", &pgnum, &dummy) != 1) || !pgnum || | 1366 | if (!pgstr || (sscanf(pgstr, "%u%c", &pgnum, &dummy) != 1) || !pgnum || |
1367 | (pgnum > m->nr_priority_groups)) { | 1367 | !m->nr_priority_groups || (pgnum > m->nr_priority_groups)) { |
1368 | DMWARN("invalid PG number supplied to switch_pg_num"); | 1368 | DMWARN("invalid PG number supplied to switch_pg_num"); |
1369 | return -EINVAL; | 1369 | return -EINVAL; |
1370 | } | 1370 | } |
@@ -1396,7 +1396,7 @@ static int bypass_pg_num(struct multipath *m, const char *pgstr, bool bypassed) | |||
1396 | char dummy; | 1396 | char dummy; |
1397 | 1397 | ||
1398 | if (!pgstr || (sscanf(pgstr, "%u%c", &pgnum, &dummy) != 1) || !pgnum || | 1398 | if (!pgstr || (sscanf(pgstr, "%u%c", &pgnum, &dummy) != 1) || !pgnum || |
1399 | (pgnum > m->nr_priority_groups)) { | 1399 | !m->nr_priority_groups || (pgnum > m->nr_priority_groups)) { |
1400 | DMWARN("invalid PG number supplied to bypass_pg"); | 1400 | DMWARN("invalid PG number supplied to bypass_pg"); |
1401 | return -EINVAL; | 1401 | return -EINVAL; |
1402 | } | 1402 | } |