Skip to content
Snippets Groups Projects
Commit 30f7bc99 authored by Eric Biggers's avatar Eric Biggers Committed by Linus Torvalds
Browse files

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

parent 8ec3d768
No related branches found
No related tags found
No related merge requests found
...@@ -327,10 +327,6 @@ EXPORT_SYMBOL(match_strlcpy); ...@@ -327,10 +327,6 @@ EXPORT_SYMBOL(match_strlcpy);
*/ */
char *match_strdup(const substring_t *s) char *match_strdup(const substring_t *s)
{ {
size_t sz = s->to - s->from + 1; return kmemdup_nul(s->from, s->to - s->from, GFP_KERNEL);
char *p = kmalloc(sz, GFP_KERNEL);
if (p)
match_strlcpy(p, s, sz);
return p;
} }
EXPORT_SYMBOL(match_strdup); EXPORT_SYMBOL(match_strdup);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment