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: Kenneth Lee <klee33@uw.edu>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
This commit is contained in:
Kenneth Lee 2022-08-18 22:42:55 -07:00 committed by Ilya Dryomov
parent 7c3ea9870e
commit aa1d627207

View File

@ -2286,7 +2286,7 @@ retry:
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;