aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dns_resolve.c
diff options
context:
space:
mode:
authorTrond Myklebust <[email protected]>2020-02-02 22:57:07 +0000
committerAnna Schumaker <[email protected]>2020-02-03 21:35:07 +0000
commita8bd9ddf397be8e0d812ce3da4e40440ac25f6d0 (patch)
treea6abffd591fd5839936d4ce7e5f51b423c96e623 /fs/nfs/dns_resolve.c
parentNFSv4: Limit the total number of cached delegations (diff)
downloadkernel-a8bd9ddf397be8e0d812ce3da4e40440ac25f6d0.tar.gz
kernel-a8bd9ddf397be8e0d812ce3da4e40440ac25f6d0.zip
NFS: Replace various occurrences of kstrndup() with kmemdup_nul()
When we already know the string length, it is more efficient to use kmemdup_nul(). Signed-off-by: Trond Myklebust <[email protected]> [Anna - Changes to super.c were already made during fscontext conversion] Signed-off-by: Anna Schumaker <[email protected]>
Diffstat (limited to 'fs/nfs/dns_resolve.c')
-rw-r--r--fs/nfs/dns_resolve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/dns_resolve.c b/fs/nfs/dns_resolve.c
index aec769a500a1..89bd5581f317 100644
--- a/fs/nfs/dns_resolve.c
+++ b/fs/nfs/dns_resolve.c
@@ -93,7 +93,7 @@ static void nfs_dns_ent_init(struct cache_head *cnew,
key = container_of(ckey, struct nfs_dns_ent, h);
kfree(new->hostname);
- new->hostname = kstrndup(key->hostname, key->namelen, GFP_KERNEL);
+ new->hostname = kmemdup_nul(key->hostname, key->namelen, GFP_KERNEL);
if (new->hostname) {
new->namelen = key->namelen;
nfs_dns_ent_update(cnew, ckey);