summaryrefslogtreecommitdiffstats
path: root/net/core/pktgen.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-06-30 23:34:49 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-06-30 23:34:49 -0400
commitb223f4e215b32849b841e750e83a915b670070f5 (patch)
tree75340f6305028de331a17255018869822b3886d2 /net/core/pktgen.c
parentf4e6d844bdc142322905d137a9e44e07eee43c5c (diff)
parent0cac643c102c0632dc2cc81e2490b0fec1cac0af (diff)
downloadlinux-b223f4e215b32849b841e750e83a915b670070f5.tar.gz
linux-b223f4e215b32849b841e750e83a915b670070f5.tar.bz2
linux-b223f4e215b32849b841e750e83a915b670070f5.zip
Merge branch 'd_real' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs into work.misc
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r--net/core/pktgen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 8604ae245960..8b02df0d354d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2245,10 +2245,8 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
hrtimer_set_expires(&t.timer, spin_until);
remaining = ktime_to_ns(hrtimer_expires_remaining(&t.timer));
- if (remaining <= 0) {
- pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
- return;
- }
+ if (remaining <= 0)
+ goto out;
start_time = ktime_get();
if (remaining < 100000) {
@@ -2273,7 +2271,9 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
}
pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time));
+out:
pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
+ destroy_hrtimer_on_stack(&t.timer);
}
static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)