UBIFS: Use kmemdup rather than duplicating its implementation

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
This commit is contained in:
Thomas Meyer
2011-11-18 00:00:52 +01:00
committed by Artem Bityutskiy
szülő cfcfc9eca2
commit eaecf43a69
3 fájl változott, egészen pontosan 5 új sor hozzáadva és 10 régi sor törölve

Fájl megtekintése

@@ -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;
}