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
This commit is contained in:
Bart Van Assche
2015-11-09 17:26:16 +00:00
parent 8c55d45181
commit 51acfdb0ac
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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");
+1 -1
View File
@@ -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;