]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/ubifs/tnc.c
UBIFS: Use kmemdup rather than duplicating its implementation
[karo-tx-linux.git] / fs / ubifs / tnc.c
index 066738647685ba8ad2d371060bfd226e12020e3b..e14ee53159db36b0ecade9b31ad6466678db6b74 100644 (file)
@@ -344,12 +344,11 @@ static int lnc_add(struct ubifs_info *c, struct ubifs_zbranch *zbr,
                return err;
        }
 
-       lnc_node = kmalloc(zbr->len, GFP_NOFS);
+       lnc_node = kmemdup(node, zbr->len, GFP_NOFS);
        if (!lnc_node)
                /* We don't have to have the cache, so no error */
                return 0;
 
-       memcpy(lnc_node, node, zbr->len);
        zbr->leaf = lnc_node;
        return 0;
 }