Commit 68d5ac2ed6180567407e4187e206df3ba6466373
Committed by
David S. Miller
1 parent
c4264f27e8
Exists in
master
and in
7 other branches
pktgen: use vzalloc_node() instead of vmalloc_node() + memset()
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 1 additions and 2 deletions Side-by-side Diff
net/core/pktgen.c
... | ... | @@ -3544,13 +3544,12 @@ |
3544 | 3544 | return -ENOMEM; |
3545 | 3545 | |
3546 | 3546 | strcpy(pkt_dev->odevname, ifname); |
3547 | - pkt_dev->flows = vmalloc_node(MAX_CFLOWS * sizeof(struct flow_state), | |
3547 | + pkt_dev->flows = vzalloc_node(MAX_CFLOWS * sizeof(struct flow_state), | |
3548 | 3548 | node); |
3549 | 3549 | if (pkt_dev->flows == NULL) { |
3550 | 3550 | kfree(pkt_dev); |
3551 | 3551 | return -ENOMEM; |
3552 | 3552 | } |
3553 | - memset(pkt_dev->flows, 0, MAX_CFLOWS * sizeof(struct flow_state)); | |
3554 | 3553 | |
3555 | 3554 | pkt_dev->removal_mark = 0; |
3556 | 3555 | pkt_dev->min_pkt_size = ETH_ZLEN; |