Commit 36c8d1e7 authored by Eric Biggers's avatar Eric Biggers Committed by Linus Torvalds
Browse files

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

parent 4ed97b3c
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -131,13 +131,10 @@ static int match_number(substring_t *s, int *result, int base)
	char *buf;
	int ret;
	long 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 = 0;
	val = simple_strtol(buf, &endp, base);