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

Commit 68d5ac2e authored by WANG Cong's avatar WANG Cong Committed by David S. Miller
Browse files

pktgen: use vzalloc_node() instead of vmalloc_node() + memset()



Signed-off-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c4264f27
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3544,13 +3544,12 @@ static int pktgen_add_device(struct pktgen_thread *t, const char *ifname)
		return -ENOMEM;

	strcpy(pkt_dev->odevname, ifname);
	pkt_dev->flows = vmalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
	pkt_dev->flows = vzalloc_node(MAX_CFLOWS * sizeof(struct flow_state),
				      node);
	if (pkt_dev->flows == NULL) {
		kfree(pkt_dev);
		return -ENOMEM;
	}
	memset(pkt_dev->flows, 0, MAX_CFLOWS * sizeof(struct flow_state));

	pkt_dev->removal_mark = 0;
	pkt_dev->min_pkt_size = ETH_ZLEN;