From a8bd9ddf397be8e0d812ce3da4e40440ac25f6d0 Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Sun, 2 Feb 2020 17:57:07 -0500 Subject: 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 [Anna - Changes to super.c were already made during fscontext conversion] Signed-off-by: Anna Schumaker --- fs/nfs/nfs4namespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/nfs/nfs4namespace.c') diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 3ea1c1008b5b..84026e7b8a5f 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -501,7 +501,7 @@ static int nfs4_try_replacing_one_location(struct nfs_server *server, rpc_set_port(sap, NFS_PORT); error = -ENOMEM; - hostname = kstrndup(buf->data, buf->len, GFP_KERNEL); + hostname = kmemdup_nul(buf->data, buf->len, GFP_KERNEL); if (hostname == NULL) break; -- cgit v1.2.3