diff options
Diffstat (limited to 'drivers/md/dm-round-robin.c')
-rw-r--r-- | drivers/md/dm-round-robin.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-round-robin.c b/drivers/md/dm-round-robin.c index 27f1d423b76..6ab1192cdd5 100644 --- a/drivers/md/dm-round-robin.c +++ b/drivers/md/dm-round-robin.c | |||
@@ -114,6 +114,7 @@ static int rr_add_path(struct path_selector *ps, struct dm_path *path, | |||
114 | struct selector *s = (struct selector *) ps->context; | 114 | struct selector *s = (struct selector *) ps->context; |
115 | struct path_info *pi; | 115 | struct path_info *pi; |
116 | unsigned repeat_count = RR_MIN_IO; | 116 | unsigned repeat_count = RR_MIN_IO; |
117 | char dummy; | ||
117 | 118 | ||
118 | if (argc > 1) { | 119 | if (argc > 1) { |
119 | *error = "round-robin ps: incorrect number of arguments"; | 120 | *error = "round-robin ps: incorrect number of arguments"; |
@@ -121,7 +122,7 @@ static int rr_add_path(struct path_selector *ps, struct dm_path *path, | |||
121 | } | 122 | } |
122 | 123 | ||
123 | /* First path argument is number of I/Os before switching path */ | 124 | /* First path argument is number of I/Os before switching path */ |
124 | if ((argc == 1) && (sscanf(argv[0], "%u", &repeat_count) != 1)) { | 125 | if ((argc == 1) && (sscanf(argv[0], "%u%c", &repeat_count, &dummy) != 1)) { |
125 | *error = "round-robin ps: invalid repeat count"; | 126 | *error = "round-robin ps: invalid repeat count"; |
126 | return -EINVAL; | 127 | return -EINVAL; |
127 | } | 128 | } |