Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kenneth Lee and committed by
Ilya Dryomov
aa1d6272 7c3ea987

+1 -1
+1 -1
fs/ceph/caps.c
··· 2286 2286 struct ceph_mds_request *req; 2287 2287 int i; 2288 2288 2289 - sessions = kzalloc(max_sessions * sizeof(s), GFP_KERNEL); 2289 + sessions = kcalloc(max_sessions, sizeof(s), GFP_KERNEL); 2290 2290 if (!sessions) { 2291 2291 err = -ENOMEM; 2292 2292 goto out;