diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-08-07 09:59:31 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-10-03 20:03:14 +0200 |
commit | bbc8a0044fb27da5fadb7efbfb472aed00c58e72 (patch) | |
tree | 65097afa4e508ec629c26bdf3302cb9d510220e0 /fs/ubifs/tnc.c | |
parent | 9ffecb10283508260936b96022d4ee43a7798b4c (diff) | |
download | linux-bbc8a0044fb27da5fadb7efbfb472aed00c58e72.tar.bz2 |
UBIFS: use kmemdup rather than duplicating its implementation
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
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 957f5757f374..fa9a20cc60d6 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c @@ -198,11 +198,10 @@ static struct ubifs_znode *copy_znode(struct ubifs_info *c, { struct ubifs_znode *zn; - zn = kmalloc(c->max_znode_sz, GFP_NOFS); + zn = kmemdup(znode, c->max_znode_sz, GFP_NOFS); if (unlikely(!zn)) return ERR_PTR(-ENOMEM); - memcpy(zn, znode, c->max_znode_sz); zn->cnext = NULL; __set_bit(DIRTY_ZNODE, &zn->flags); __clear_bit(COW_ZNODE, &zn->flags); |