提交 4ed97b3c 编写于 作者: E Eric Biggers 提交者: Linus Torvalds

lib/parser.c: switch match_u64int() over to use match_strdup()

This simplifies the code.  No change in behavior.

Link: http://lkml.kernel.org/r/20180830194814.192880-1-ebiggers@kernel.orgSigned-off-by: NEric Biggers <ebiggers@google.com>
Reviewed-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 30f7bc99
......@@ -166,13 +166,10 @@ static int match_u64int(substring_t *s, u64 *result, int base)
char *buf;
int ret;
u64 val;
size_t len = s->to - s->from;
buf = kmalloc(len + 1, GFP_KERNEL);
buf = match_strdup(s);
if (!buf)
return -ENOMEM;
memcpy(buf, s->from, len);
buf[len] = '\0';
ret = kstrtoull(buf, base, &val);
if (!ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册