diff options
author | Trond Myklebust <trondmy@gmail.com> | 2020-02-02 23:57:08 +0100 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2020-02-03 22:35:07 +0100 |
commit | 7ccbddbe3e67591a02ddd20078d1241bd8fe79f3 (patch) | |
tree | 84a93a414f74d858ecb10c41ba1a1cfc61476344 /net/sunrpc | |
parent | NFS: Replace various occurrences of kstrndup() with kmemdup_nul() (diff) | |
download | linux-7ccbddbe3e67591a02ddd20078d1241bd8fe79f3.tar.xz linux-7ccbddbe3e67591a02ddd20078d1241bd8fe79f3.zip |
SUNRPC: Use kmemdup_nul() in rpc_parse_scope_id()
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>
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/addr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c index d024af4be85e..8b4d72b1a066 100644 --- 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 = kstrndup(delim + 1, len, GFP_KERNEL); + p = kmemdup_nul(delim + 1, len, GFP_KERNEL); if (p) { u32 scope_id = 0; struct net_device *dev; |