summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-08-27 13:55:10 +0000
committerDavid S. Miller <davem@davemloft.net>2009-08-28 23:31:53 -0700
commit3bda06a3d7987bfeabb218ac2f17ce22c34f13b3 (patch)
tree03c29b206fea9df7655ae153fad3f61916d80457 /net/core
parent65c5b786a37746302e225223c0d8b760d4c48a8b (diff)
pktgen: stop_device cleanup
All the callers were freeing skb after stopping device. Remove unneeded forward decl. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/pktgen.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index ccbc3a48cc2..1b1f1262a27 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -424,7 +424,7 @@ static int pktgen_device_event(struct notifier_block *, unsigned long, void *);
static void pktgen_run_all_threads(void);
static void pktgen_reset_all_threads(void);
static void pktgen_stop_all_threads_ifs(void);
-static int pktgen_stop_device(struct pktgen_dev *pkt_dev);
+
static void pktgen_stop(struct pktgen_thread *t);
static void pktgen_clear_counters(struct pktgen_dev *pkt_dev);
@@ -3221,7 +3221,6 @@ static void show_results(struct pktgen_dev *pkt_dev, int nr_frags)
}
/* Set stopped-at timer, remove from running list, do counters & statistics */
-
static int pktgen_stop_device(struct pktgen_dev *pkt_dev)
{
int nr_frags = pkt_dev->skb ? skb_shinfo(pkt_dev->skb)->nr_frags : -1;
@@ -3232,6 +3231,8 @@ static int pktgen_stop_device(struct pktgen_dev *pkt_dev)
return -EINVAL;
}
+ kfree_skb(pkt_dev->skb);
+ pkt_dev->skb = NULL;
pkt_dev->stopped_at = getCurUs();
pkt_dev->running = 0;
@@ -3268,9 +3269,6 @@ static void pktgen_stop(struct pktgen_thread *t)
list_for_each_entry(pkt_dev, &t->if_list, list) {
pktgen_stop_device(pkt_dev);
- kfree_skb(pkt_dev->skb);
-
- pkt_dev->skb = NULL;
}
if_unlock(t);
@@ -3382,8 +3380,6 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
if (!netif_running(odev)) {
pktgen_stop_device(pkt_dev);
- kfree_skb(pkt_dev->skb);
- pkt_dev->skb = NULL;
goto out;
}
if (need_resched())
@@ -3486,8 +3482,6 @@ static void pktgen_xmit(struct pktgen_dev *pkt_dev)
/* Done with this */
pktgen_stop_device(pkt_dev);
- kfree_skb(pkt_dev->skb);
- pkt_dev->skb = NULL;
}
out:;
}