Merge remote branch 'wireless-next/master' into ath6kl-next
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / nfs4xdr.c
index b6fa792d6b858b5950c483092e7c05ca8c583446..0ec5a1b9700e5e8d59196cfa387f608aa5c7f0ce 100644 (file)
@@ -215,10 +215,9 @@ defer_free(struct nfsd4_compoundargs *argp,
 static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
 {
        if (p == argp->tmp) {
-               p = kmalloc(nbytes, GFP_KERNEL);
+               p = kmemdup(argp->tmp, nbytes, GFP_KERNEL);
                if (!p)
                        return NULL;
-               memcpy(p, argp->tmp, nbytes);
        } else {
                BUG_ON(p != argp->tmpp);
                argp->tmpp = NULL;