aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4state.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfs4state.c')
-rw-r--r--fs/nfsd/nfs4state.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index a84978c13bb8..6ab677913f9c 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -986,12 +986,11 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
986 clp = kzalloc(sizeof(struct nfs4_client), GFP_KERNEL); 986 clp = kzalloc(sizeof(struct nfs4_client), GFP_KERNEL);
987 if (clp == NULL) 987 if (clp == NULL)
988 return NULL; 988 return NULL;
989 clp->cl_name.data = kmalloc(name.len, GFP_KERNEL); 989 clp->cl_name.data = kmemdup(name.data, name.len, GFP_KERNEL);
990 if (clp->cl_name.data == NULL) { 990 if (clp->cl_name.data == NULL) {
991 kfree(clp); 991 kfree(clp);
992 return NULL; 992 return NULL;
993 } 993 }
994 memcpy(clp->cl_name.data, name.data, name.len);
995 clp->cl_name.len = name.len; 994 clp->cl_name.len = name.len;
996 return clp; 995 return clp;
997} 996}