diff options
author | Trond Myklebust | 2012-05-21 10:12:39 -0400 |
---|---|---|
committer | Trond Myklebust | 2012-05-21 10:12:39 -0400 |
commit | b3f87b98aa3dc22cc58f970140113b270015cddb (patch) | |
tree | c4aec5996567ad96310f61e9244e799f41bf2625 /net/core/pktgen.c | |
parent | 041245c88a29273788e8eff1353bc6e1f56c61df (diff) | |
parent | 1afeaf5c29aa07db25760d2fbed5c08a3aec3498 (diff) |
Merge branch 'bugfixes' into nfs-for-next
Diffstat (limited to 'net/core/pktgen.c')
-rw-r--r-- | net/core/pktgen.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 4d8ce93cd503..77a59980b579 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -1931,7 +1931,7 @@ static int pktgen_device_event(struct notifier_block *unused, { struct net_device *dev = ptr; - if (!net_eq(dev_net(dev), &init_net)) + if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting) return NOTIFY_DONE; /* It is OK that we do not hold the group lock right now, @@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void) { struct pktgen_thread *t; struct list_head *q, *n; + struct list_head list; /* Stop all interfaces & threads */ pktgen_exiting = true; - list_for_each_safe(q, n, &pktgen_threads) { + mutex_lock(&pktgen_thread_lock); + list_splice(&list, &pktgen_threads); + mutex_unlock(&pktgen_thread_lock); + + list_for_each_safe(q, n, &list) { t = list_entry(q, struct pktgen_thread, th_list); + list_del(&t->th_list); kthread_stop(t->tsk); kfree(t); } |