From 51acfdb0ac49825070fedca9f28fe9b1ab4695a1 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Mon, 9 Nov 2015 17:26:16 +0000 Subject: [PATCH] isert-scst: Use kcalloc() instead of kzalloc() with multiply git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6624 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_rdma.c | 3 ++- iscsi-scst/kernel/isert-scst/isert_login.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index 1f1c56e66..6a1e9279d 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -870,7 +870,8 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev) isert_dev->num_cqs = min_t(int, num_online_cpus(), ib_dev->num_comp_vectors); - isert_dev->cq_qps = kzalloc(sizeof(*isert_dev->cq_qps) * isert_dev->num_cqs, + isert_dev->cq_qps = kcalloc(isert_dev->num_cqs, + sizeof(*isert_dev->cq_qps), GFP_KERNEL); if (unlikely(isert_dev->cq_qps == NULL)) { pr_err("Failed to allocate iser cq_qps\n"); diff --git a/iscsi-scst/kernel/isert-scst/isert_login.c b/iscsi-scst/kernel/isert-scst/isert_login.c index 517a6f257..0a3720306 100644 --- a/iscsi-scst/kernel/isert-scst/isert_login.c +++ b/iscsi-scst/kernel/isert-scst/isert_login.c @@ -952,7 +952,7 @@ int __init isert_init_login_devs(unsigned int ndevs) * allocate the devices -- we can't have them static, as the number * can be specified at load time */ - isert_conn_devices = kzalloc(n_devs * sizeof(struct isert_conn_dev), + isert_conn_devices = kcalloc(n_devs, sizeof(struct isert_conn_dev), GFP_KERNEL); if (unlikely(!isert_conn_devices)) { res = -ENOMEM;