mirror of
https://github.com/torvalds/linux.git
synced 2026-05-14 17:32:42 +02:00
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 @@ static int flush_mdlog_and_wait_inode_unsafe_requests(struct inode *inode)
|
|||
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
Block a user