aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-stripe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-stripe.c')
-rw-r--r--drivers/md/dm-stripe.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index 35c94ff24ad5..183db5d3e48e 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -99,7 +99,6 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
99 sector_t width; 99 sector_t width;
100 uint32_t stripes; 100 uint32_t stripes;
101 uint32_t chunk_size; 101 uint32_t chunk_size;
102 char *end;
103 int r; 102 int r;
104 unsigned int i; 103 unsigned int i;
105 104
@@ -108,14 +107,12 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
108 return -EINVAL; 107 return -EINVAL;
109 } 108 }
110 109
111 stripes = simple_strtoul(argv[0], &end, 10); 110 if (kstrtouint(argv[0], 10, &stripes) || !stripes) {
112 if (!stripes || *end) {
113 ti->error = "Invalid stripe count"; 111 ti->error = "Invalid stripe count";
114 return -EINVAL; 112 return -EINVAL;
115 } 113 }
116 114
117 chunk_size = simple_strtoul(argv[1], &end, 10); 115 if (kstrtouint(argv[1], 10, &chunk_size)) {
118 if (*end) {
119 ti->error = "Invalid chunk_size"; 116 ti->error = "Invalid chunk_size";
120 return -EINVAL; 117 return -EINVAL;
121 } 118 }