aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorKenneth Lee <klee33@uw.edu>2022-08-18 22:42:55 -0700
committerIlya Dryomov <idryomov@gmail.com>2022-10-04 19:18:08 +0200
commitaa1d627207cace003163dee24d1c06fa4e910c6b (patch)
tree5e33e9d78dac8780ea5029a214e2185829118db0
parentceph: no need to wait for transition RDCACHE|RD -> RD (diff)
downloadwireguard-linux-aa1d627207cace003163dee24d1c06fa4e910c6b.tar.xz
wireguard-linux-aa1d627207cace003163dee24d1c06fa4e910c6b.zip
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>
-rw-r--r--fs/ceph/caps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c
index 0dc1251c3c6d..fb023f9fafcb 100644
--- a/fs/ceph/caps.c
+++ b/fs/ceph/caps.c
@@ -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;