summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0055-pktgen-fix-module-unload-for-good.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0055-pktgen-fix-module-unload-for-good.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0055-pktgen-fix-module-unload-for-good.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0055-pktgen-fix-module-unload-for-good.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0055-pktgen-fix-module-unload-for-good.patch
new file mode 100644
index 00000000..1f86f355
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.18/0055-pktgen-fix-module-unload-for-good.patch
@@ -0,0 +1,48 @@
1From 20b87e11f8ebb8b1fa74b668770c7f2b301b40b4 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <edumazet@google.com>
3Date: Thu, 17 May 2012 23:52:26 +0000
4Subject: [PATCH 55/56] pktgen: fix module unload for good
5
6commit d4b1133558e0d417342d5d2c49e4c35b428ff20d upstream.
7
8commit c57b5468406 (pktgen: fix crash at module unload) did a very poor
9job with list primitives.
10
111) list_splice() arguments were in the wrong order
12
132) list_splice(list, head) has undefined behavior if head is not
14initialized.
15
163) We should use the list_splice_init() variant to clear pktgen_threads
17list.
18
19Signed-off-by: Eric Dumazet <edumazet@google.com>
20Signed-off-by: David S. Miller <davem@davemloft.net>
21Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
22---
23 net/core/pktgen.c | 4 ++--
24 1 files changed, 2 insertions(+), 2 deletions(-)
25
26diff --git a/net/core/pktgen.c b/net/core/pktgen.c
27index 657e5f9..df878de 100644
28--- a/net/core/pktgen.c
29+++ b/net/core/pktgen.c
30@@ -3758,13 +3758,13 @@ static void __exit pg_cleanup(void)
31 {
32 struct pktgen_thread *t;
33 struct list_head *q, *n;
34- struct list_head list;
35+ LIST_HEAD(list);
36
37 /* Stop all interfaces & threads */
38 pktgen_exiting = true;
39
40 mutex_lock(&pktgen_thread_lock);
41- list_splice(&list, &pktgen_threads);
42+ list_splice_init(&pktgen_threads, &list);
43 mutex_unlock(&pktgen_thread_lock);
44
45 list_for_each_safe(q, n, &list) {
46--
471.7.7.6
48