lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a19efeb8-fd7c-274b-bd59-adbc3a473cfb@users.sourceforge.net>
Date:   Fri, 7 Apr 2017 23:09:08 +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 9/9] IB/isert: Improve size determinations in three functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 7 Apr 2017 22:20:39 +0200

Replace the specification of three data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determinations 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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
index c56af6183082..5dafda92a642 100644
--- a/drivers/infiniband/ulp/isert/ib_isert.c
+++ b/drivers/infiniband/ulp/isert/ib_isert.c
@@ -368,7 +368,7 @@ isert_device_get(struct rdma_cm_id *cma_id)
 		}
 	}
 
-	device = kzalloc(sizeof(struct isert_device), GFP_KERNEL);
+	device = kzalloc(sizeof(*device), GFP_KERNEL);
 	if (!device) {
 		mutex_unlock(&device_list_mutex);
 		return ERR_PTR(-ENOMEM);
@@ -516,7 +516,7 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event)
 	isert_dbg("cma_id: %p, portal: %p\n",
 		 cma_id, cma_id->context);
 
-	isert_conn = kzalloc(sizeof(struct isert_conn), GFP_KERNEL);
+	isert_conn = kzalloc(sizeof(*isert_conn), GFP_KERNEL);
 	if (!isert_conn)
 		return -ENOMEM;
 
@@ -2306,7 +2306,7 @@ isert_setup_np(struct iscsi_np *np,
 	struct rdma_cm_id *isert_lid;
 	int ret;
 
-	isert_np = kzalloc(sizeof(struct isert_np), GFP_KERNEL);
+	isert_np = kzalloc(sizeof(*isert_np), GFP_KERNEL);
 	if (!isert_np)
 		return -ENOMEM;
 
-- 
2.12.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ