mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-01 03:44:08 +00:00
lib/parser.c: switch match_strdup() over to use kmemdup_nul()
This simplifies the code. No change in behavior. Link: http://lkml.kernel.org/r/20180830194436.188867-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
8ec3d76863
commit
30f7bc99a2
1 changed files with 1 additions and 5 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue