diff options
-rw-r--r-- | fs/ceph/xattr.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index a76f697303d9..bfff735091f5 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c | |||
@@ -730,11 +730,9 @@ int ceph_setxattr(struct dentry *dentry, const char *name, | |||
730 | goto out; | 730 | goto out; |
731 | 731 | ||
732 | if (val_len) { | 732 | if (val_len) { |
733 | newval = kmalloc(val_len + 1, GFP_NOFS); | 733 | newval = kmemdup(value, val_len, GFP_NOFS); |
734 | if (!newval) | 734 | if (!newval) |
735 | goto out; | 735 | goto out; |
736 | memcpy(newval, value, val_len); | ||
737 | newval[val_len] = '\0'; | ||
738 | } | 736 | } |
739 | 737 | ||
740 | xattr = kmalloc(sizeof(struct ceph_inode_xattr), GFP_NOFS); | 738 | xattr = kmalloc(sizeof(struct ceph_inode_xattr), GFP_NOFS); |