ceph: Use kcalloc for allocating multiple elements
authorKenneth Lee <klee33@uw.edu>
Fri, 19 Aug 2022 05:42:55 +0000 (22:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:03 +0000 (17:40 +0100)
commit00c004c070f22a47063de4ff2a5638fce1f94d95
tree77a8d9a289ec23c6365877e252547aec146545fb
parent69263bf781bef3841f22815b834a5243474aa6d4
ceph: Use kcalloc for allocating multiple elements

[ Upstream commit aa1d627207cace003163dee24d1c06fa4e910c6b ]

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>
Stable-dep-of: 5bd76b8de5b7 ("ceph: fix NULL pointer dereference for req->r_session")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ceph/caps.c