mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
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>
This commit is contained in:
parent
a8bd9ddf39
commit
7ccbddbe3e
1 changed files with 1 additions and 1 deletions
|
@ -175,7 +175,7 @@ static int rpc_parse_scope_id(struct net *net, const char *buf,
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
len = (buf + buflen) - delim - 1;
|
len = (buf + buflen) - delim - 1;
|
||||||
p = kstrndup(delim + 1, len, GFP_KERNEL);
|
p = kmemdup_nul(delim + 1, len, GFP_KERNEL);
|
||||||
if (p) {
|
if (p) {
|
||||||
u32 scope_id = 0;
|
u32 scope_id = 0;
|
||||||
struct net_device *dev;
|
struct net_device *dev;
|
||||||
|
|
Loading…
Reference in a new issue