Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10168
b: refs/heads/master
c: 2845b63
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Arnaldo Carvalho de Melo committed Oct 26, 2005
1 parent 08ad6aa commit fda01bf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7c8921bf1a8a9c1907b1eeb029d3f167be226f3
refs/heads/master: 2845b63b504b051a9cb4d78bed8b3594451a1f6f
7 changes: 2 additions & 5 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2869,12 +2869,10 @@ static int pktgen_add_device(struct pktgen_thread *t, const char* ifname)

if( (pkt_dev = __pktgen_NN_threads(ifname, FIND)) == NULL) {

pkt_dev = kmalloc(sizeof(struct pktgen_dev), GFP_KERNEL);
pkt_dev = kzalloc(sizeof(struct pktgen_dev), GFP_KERNEL);
if (!pkt_dev)
return -ENOMEM;

memset(pkt_dev, 0, sizeof(struct pktgen_dev));

pkt_dev->flows = vmalloc(MAX_CFLOWS*sizeof(struct flow_state));
if (pkt_dev->flows == NULL) {
kfree(pkt_dev);
Expand Down Expand Up @@ -2958,13 +2956,12 @@ static int pktgen_create_thread(const char* name, int cpu)
return -EINVAL;
}

t = (struct pktgen_thread*)(kmalloc(sizeof(struct pktgen_thread), GFP_KERNEL));
t = kzalloc(sizeof(struct pktgen_thread), GFP_KERNEL);
if (!t) {
printk("pktgen: ERROR: out of memory, can't create new thread.\n");
return -ENOMEM;
}

memset(t, 0, sizeof(struct pktgen_thread));
strcpy(t->name, name);
spin_lock_init(&t->if_lock);
t->cpu = cpu;
Expand Down

0 comments on commit fda01bf

Please sign in to comment.