[PATCH 2/3] RDS: IB: Improve a size determination in rds_ib_add_one()

From: SF Markus Elfring
Date: Mon May 22 2017 - 10:12:56 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 May 2017 15:40:21 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
net/rds/ib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rds/ib.c b/net/rds/ib.c
index c5514d058171..ed37bf011704 100644
--- a/net/rds/ib.c
+++ b/net/rds/ib.c
@@ -131,7 +131,7 @@ static void rds_ib_add_one(struct ib_device *device)
if (device->node_type != RDMA_NODE_IB_CA)
return;

- rds_ibdev = kzalloc_node(sizeof(struct rds_ib_device), GFP_KERNEL,
+ rds_ibdev = kzalloc_node(sizeof(*rds_ibdev), GFP_KERNEL,
ibdev_to_node(device));
if (!rds_ibdev)
return;
--
2.13.0