summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuqian Huang <huangfq.daxian@gmail.com>2019-07-03 19:27:42 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-07-03 20:34:42 +0300
commitcda8cf56d8e29c70dc8a3d989846c66ed1638e74 (patch)
tree3b058b97768593ee64c2169fef451b38945c3565
parent5d7d78eaecc5c91c9b2001e544a0ae2788d40d1c (diff)
downloadlinux-cda8cf56d8e29c70dc8a3d989846c66ed1638e74.tar.xz
IB/i40iw: Use kmemdup rather than open coding
Use kmemdump instead of kzmalloc + memcpy. Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com> Reviewed-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw_cm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c
index 8233f5a4e623..84b3ff2687fb 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
@@ -4276,11 +4276,11 @@ static void i40iw_qhash_ctrl(struct i40iw_device *iwdev,
/* if not found then add a child listener if interface is going up */
if (!ifup)
return;
- child_listen_node = kzalloc(sizeof(*child_listen_node), GFP_ATOMIC);
+ child_listen_node = kmemdup(parent_listen_node,
+ sizeof(*child_listen_node), GFP_ATOMIC);
if (!child_listen_node)
return;
node_allocated = true;
- memcpy(child_listen_node, parent_listen_node, sizeof(*child_listen_node));
memcpy(child_listen_node->loc_addr, ipaddr, ipv4 ? 4 : 16);