aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph')
-rw-r--r--fs/ceph/xattr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
index 70e919960acb..6e12a6ba5f79 100644
--- a/fs/ceph/xattr.c
+++ b/fs/ceph/xattr.c
@@ -716,10 +716,9 @@ int ceph_setxattr(struct dentry *dentry, const char *name,
716 716
717 /* preallocate memory for xattr name, value, index node */ 717 /* preallocate memory for xattr name, value, index node */
718 err = -ENOMEM; 718 err = -ENOMEM;
719 newname = kmalloc(name_len + 1, GFP_NOFS); 719 newname = kmemdup(name, name_len + 1, GFP_NOFS);
720 if (!newname) 720 if (!newname)
721 goto out; 721 goto out;
722 memcpy(newname, name, name_len + 1);
723 722
724 if (val_len) { 723 if (val_len) {
725 newval = kmalloc(val_len + 1, GFP_NOFS); 724 newval = kmalloc(val_len + 1, GFP_NOFS);