[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4813638-f7d2-156f-89fa-4821ad186524@users.sourceforge.net>
Date: Fri, 7 Apr 2017 23:08:19 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-rdma@...r.kernel.org, target-devel@...r.kernel.org,
David Ahern <dsa@...ulusnetworks.com>,
Doug Ledford <dledford@...hat.com>,
Erez Shitrit <erezsh@...lanox.com>,
Feras Daoud <ferasda@...lanox.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Leon Romanovsky <leon@...nel.org>,
Mark Bloch <markb@...lanox.com>,
Or Gerlitz <ogerlitz@...lanox.com>,
Paolo Abeni <pabeni@...hat.com>, Roi Dayan <roid@...lanox.com>,
Sagi Grimberg <sagi@...mberg.me>,
Sean Hefty <sean.hefty@...el.com>,
Yuval Shaia <yuval.shaia@...cle.com>,
Zhu Yanjun <yanjun.zhu@...cle.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 8/9] IB/isert: Use kcalloc() in isert_alloc_rx_descriptors()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 7 Apr 2017 22:00:43 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus use the corresponding function "kcalloc".
* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/infiniband/ulp/isert/ib_isert.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index 91cbe86b25c8..c56af6183082 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -181,8 +181,9 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn)
u64 dma_addr;
int i, j;
- isert_conn->rx_descs = kzalloc(ISERT_QP_MAX_RECV_DTOS *
- sizeof(struct iser_rx_desc), GFP_KERNEL);
+ isert_conn->rx_descs = kcalloc(ISERT_QP_MAX_RECV_DTOS,
+ sizeof(*isert_conn->rx_descs),
+ GFP_KERNEL);
if (!isert_conn->rx_descs)
return -ENOMEM;
--
2.12.2
Powered by blists - more mailing lists