diff options
Diffstat (limited to 'fs/ubifs/tnc.c')
-rw-r--r-- | fs/ubifs/tnc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index 066738647685..e14ee53159db 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, | |||
344 | return err; | 344 | return err; |
345 | } | 345 | } |
346 | 346 | ||
347 | lnc_node = kmalloc(zbr->len, GFP_NOFS); | 347 | lnc_node = kmemdup(node, zbr->len, GFP_NOFS); |
348 | if (!lnc_node) | 348 | if (!lnc_node) |
349 | /* We don't have to have the cache, so no error */ | 349 | /* We don't have to have the cache, so no error */ |
350 | return 0; | 350 | return 0; |
351 | 351 | ||
352 | memcpy(lnc_node, node, zbr->len); | ||
353 | zbr->leaf = lnc_node; | 352 | zbr->leaf = lnc_node; |
354 | return 0; | 353 | return 0; |
355 | } | 354 | } |