diff options
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index b6fa792d6b85..0ec5a1b9700e 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -215,10 +215,9 @@ defer_free(struct nfsd4_compoundargs *argp, | |||
215 | static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes) | 215 | static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes) |
216 | { | 216 | { |
217 | if (p == argp->tmp) { | 217 | if (p == argp->tmp) { |
218 | p = kmalloc(nbytes, GFP_KERNEL); | 218 | p = kmemdup(argp->tmp, nbytes, GFP_KERNEL); |
219 | if (!p) | 219 | if (!p) |
220 | return NULL; | 220 | return NULL; |
221 | memcpy(p, argp->tmp, nbytes); | ||
222 | } else { | 221 | } else { |
223 | BUG_ON(p != argp->tmpp); | 222 | BUG_ON(p != argp->tmpp); |
224 | argp->tmpp = NULL; | 223 | argp->tmpp = NULL; |