diff options
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.patch | 48 |
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 @@ | |||
1 | From 20b87e11f8ebb8b1fa74b668770c7f2b301b40b4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Eric Dumazet <edumazet@google.com> | ||
3 | Date: Thu, 17 May 2012 23:52:26 +0000 | ||
4 | Subject: [PATCH 55/56] pktgen: fix module unload for good | ||
5 | |||
6 | commit d4b1133558e0d417342d5d2c49e4c35b428ff20d upstream. | ||
7 | |||
8 | commit c57b5468406 (pktgen: fix crash at module unload) did a very poor | ||
9 | job with list primitives. | ||
10 | |||
11 | 1) list_splice() arguments were in the wrong order | ||
12 | |||
13 | 2) list_splice(list, head) has undefined behavior if head is not | ||
14 | initialized. | ||
15 | |||
16 | 3) We should use the list_splice_init() variant to clear pktgen_threads | ||
17 | list. | ||
18 | |||
19 | Signed-off-by: Eric Dumazet <edumazet@google.com> | ||
20 | Signed-off-by: David S. Miller <davem@davemloft.net> | ||
21 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
22 | --- | ||
23 | net/core/pktgen.c | 4 ++-- | ||
24 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
25 | |||
26 | diff --git a/net/core/pktgen.c b/net/core/pktgen.c | ||
27 | index 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 | -- | ||
47 | 1.7.7.6 | ||
48 | |||