From: Ilya Dryomov Date: Fri, 25 Jul 2014 08:44:58 +0000 (+0400) Subject: ceph: remove redundant memset(0) X-Git-Tag: firefly_0821_release~176^2~3410^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1a295bd8c854de221813d0ba0848031a8985b869;p=firefly-linux-kernel-4.4.55.git ceph: remove redundant memset(0) xattrs array of pointers is allocated with kcalloc() - no need to memset() it to 0 right after that. Signed-off-by: Ilya Dryomov Reviewed-by: Alex Elder --- diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c index c9c2b887381e..f89698cdbc41 100644 --- a/fs/ceph/xattr.c +++ b/fs/ceph/xattr.c @@ -597,7 +597,7 @@ start: err = -ENOMEM; if (!xattrs) goto bad_lock; - memset(xattrs, 0, numattr*sizeof(struct ceph_xattr *)); + for (i = 0; i < numattr; i++) { xattrs[i] = kmalloc(sizeof(struct ceph_inode_xattr), GFP_NOFS);