projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8ec3d76
)
lib/parser.c: switch match_strdup() over to use kmemdup_nul()
author
Eric Biggers
<
[email protected]
>
Tue, 30 Oct 2018 22:05:22 +0000
(15:05 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 31 Oct 2018 15:54:12 +0000
(08:54 -0700)
This simplifies the code. No change in behavior.
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Eric Biggers <
[email protected]
>
Reviewed-by: Andrew Morton <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/parser.c
patch
|
blob
|
history
diff --git
a/lib/parser.c
b/lib/parser.c
index 3278958b472a990bd777842c1b11ea0c4bb969bd..0142ef28f0eb4a432d310aa4edc8bd770880876b 100644
(file)
--- 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);