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:
parent
7c3ea9870e
commit
aa1d627207
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue