diff mbox

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

Message ID BANLkTimWSEwkoP3GOjZ3C-yG9jZRVM+yNA@mail.gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Cong Wang May 22, 2011, 10:17 a.m. UTC
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>

---

Comments

David Miller May 23, 2011, 1:02 a.m. UTC | #1
From: Américo Wang <xiyou.wangcong@gmail.com>
Date: Sun, 22 May 2011 18:17:11 +0800

> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> Cc: "David S. Miller" <davem@davemloft.net>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 67870e9..3b85c0d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -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;