Skip to content

Commit

Permalink
ceph: remove redundant memset(0)
Browse files Browse the repository at this point in the history
xattrs array of pointers is allocated with kcalloc() - no need to
memset() it to 0 right after that.

Signed-off-by: Ilya Dryomov <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
  • Loading branch information
idryomov committed Jul 28, 2014
1 parent 4d9b67c commit 1a295bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static int __build_xattrs(struct inode *inode)
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);
Expand Down

0 comments on commit 1a295bd

Please sign in to comment.