diff options
Diffstat (limited to 'lib/parser.c')
-rw-r--r-- | lib/parser.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/parser.c b/lib/parser.c index 0142ef28f0eb..618c36ec8efe 100644 --- a/lib/parser.c +++ b/lib/parser.c | |||
@@ -166,13 +166,10 @@ static int match_u64int(substring_t *s, u64 *result, int base) | |||
166 | char *buf; | 166 | char *buf; |
167 | int ret; | 167 | int ret; |
168 | u64 val; | 168 | u64 val; |
169 | size_t len = s->to - s->from; | ||
170 | 169 | ||
171 | buf = kmalloc(len + 1, GFP_KERNEL); | 170 | buf = match_strdup(s); |
172 | if (!buf) | 171 | if (!buf) |
173 | return -ENOMEM; | 172 | return -ENOMEM; |
174 | memcpy(buf, s->from, len); | ||
175 | buf[len] = '\0'; | ||
176 | 173 | ||
177 | ret = kstrtoull(buf, base, &val); | 174 | ret = kstrtoull(buf, base, &val); |
178 | if (!ret) | 175 | if (!ret) |