Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cda8cf56 authored by Fuqian Huang's avatar Fuqian Huang Committed by Jason Gunthorpe
Browse files

IB/i40iw: Use kmemdup rather than open coding



Use kmemdump instead of kzmalloc + memcpy.

Signed-off-by: default avatarFuqian Huang <huangfq.daxian@gmail.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 5d7d78ea
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);