OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8bd9dd
)
SUNRPC: Use kmemdup_nul() in rpc_parse_scope_id()
author
Trond Myklebust
<trondmy@gmail.com>
Sun, 2 Feb 2020 22:57:08 +0000
(17:57 -0500)
committer
Anna Schumaker
<Anna.Schumaker@Netapp.com>
Mon, 3 Feb 2020 21:35:07 +0000
(16:35 -0500)
Using kmemdup_nul() is more efficient when the length is known.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/addr.c
patch
|
blob
|
history
diff --git
a/net/sunrpc/addr.c
b/net/sunrpc/addr.c
index
d024af4
..
8b4d72b
100644
(file)
--- a/
net/sunrpc/addr.c
+++ b/
net/sunrpc/addr.c
@@
-175,7
+175,7
@@
static int rpc_parse_scope_id(struct net *net, const char *buf,
return 0;
len = (buf + buflen) - delim - 1;
- p = k
strndup
(delim + 1, len, GFP_KERNEL);
+ p = k
memdup_nul
(delim + 1, len, GFP_KERNEL);
if (p) {
u32 scope_id = 0;
struct net_device *dev;