Commit 4efd9f0d authored by Shuqi Zhang's avatar Shuqi Zhang Committed by Theodore Ts'o
Browse files

ext4: use kmemdup() to replace kmalloc + memcpy

parent 9b6641dd
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1895,11 +1895,10 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,

			unlock_buffer(bs->bh);
			ea_bdebug(bs->bh, "cloning");
			s->base = kmalloc(bs->bh->b_size, GFP_NOFS);
			s->base = kmemdup(BHDR(bs->bh), bs->bh->b_size, GFP_NOFS);
			error = -ENOMEM;
			if (s->base == NULL)
				goto cleanup;
			memcpy(s->base, BHDR(bs->bh), bs->bh->b_size);
			s->first = ENTRY(header(s->base)+1);
			header(s->base)->h_refcount = cpu_to_le32(1);
			s->here = ENTRY(s->base + offset);