Commit d4b11335 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

pktgen: fix module unload for good

commit c57b5468 (pktgen: fix crash at module unload) did a very poor
job with list primitives.

1) list_splice() arguments were in the wrong order

2) list_splice(list, head) has undefined behavior if head is not

3) We should use the list_splice_init() variant to clear pktgen_threads
Signed-off-by: default avatarEric Dumazet <>
Signed-off-by: default avatarDavid S. Miller <>
parent 42ea7d7f
......@@ -3755,13 +3755,13 @@ 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_splice(&list, &pktgen_threads);
list_splice_init(&pktgen_threads, &list);
list_for_each_safe(q, n, &list) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment