Commit aa1d6272 authored by Kenneth Lee's avatar Kenneth Lee Committed by Ilya Dryomov
Browse files

ceph: Use kcalloc for allocating multiple elements



Prefer using kcalloc(a, b) over kzalloc(a * b) as this improves
semantics since kcalloc is intended for allocating an array of memory.

Signed-off-by: default avatarKenneth Lee <klee33@uw.edu>
Reviewed-by: default avatarXiubo Li <xiubli@redhat.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 7c3ea987
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2286,7 +2286,7 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode)
		struct ceph_mds_request *req;
		int i;

		sessions = kzalloc(max_sessions * sizeof(s), GFP_KERNEL);
		sessions = kcalloc(max_sessions, sizeof(s), GFP_KERNEL);
		if (!sessions) {
			err = -ENOMEM;
			goto out;