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:

committed by
Artem Bityutskiy

szülő
cfcfc9eca2
commit
eaecf43a69
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user