X-Git-Url: https://git.openfabrics.org/?p=~shefty%2Frdma-dev.git;a=blobdiff_plain;f=fs%2Fubifs%2Ftnc.c;h=16ad84d8402f31a5729f86c3b15f20a129f49efd;hp=cbd6dd31098721ecbd43afbea0bad30af19e8e72;hb=94b1984ab9ab61cc6047c07e074d766485299a9c;hpb=515315a123af641a9533e4ff0f178c470dc08fc7 diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index cbd6dd31098..16ad84d8402 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -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; }