summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/parser.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/parser.c b/lib/parser.c
index 3278958b472a..0142ef28f0eb 100644
--- a/lib/parser.c
+++ b/lib/parser.c
@@ -327,10 +327,6 @@ EXPORT_SYMBOL(match_strlcpy);
*/
char *match_strdup(const substring_t *s)
{
- size_t sz = s->to - s->from + 1;
- char *p = kmalloc(sz, GFP_KERNEL);
- if (p)
- match_strlcpy(p, s, sz);
- return p;
+ return kmemdup_nul(s->from, s->to - s->from, GFP_KERNEL);
}
EXPORT_SYMBOL(match_strdup);