|
|
f43afa |
From e695d462f82f64f567aadbdbe9d4c2389a406321 Mon Sep 17 00:00:00 2001
|
|
|
f43afa |
From: Torsten Polle <Torsten.Polle@gmx.de>
|
|
|
f43afa |
Date: Fri, 7 Mar 2014 14:37:11 -0600
|
|
|
f43afa |
Subject: [PATCH 6/8] Fix: Crash when canceling task work.
|
|
|
f43afa |
|
|
|
f43afa |
As the elements of the list __stp_tf_task_work_list are removed from
|
|
|
f43afa |
the list, a safe iteration has to be used in __stp_tf_cancel_task_work().
|
|
|
f43afa |
---
|
|
|
f43afa |
runtime/linux/task_finder2.c | 3 ++-
|
|
|
f43afa |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
f43afa |
|
|
|
f43afa |
diff --git a/runtime/linux/task_finder2.c b/runtime/linux/task_finder2.c
|
|
|
f43afa |
index 16fda87..e8f33a3 100644
|
|
|
f43afa |
--- a/runtime/linux/task_finder2.c
|
|
|
f43afa |
+++ b/runtime/linux/task_finder2.c
|
|
|
f43afa |
@@ -169,11 +169,12 @@ static void __stp_tf_free_task_work(struct task_work *work)
|
|
|
f43afa |
static void __stp_tf_cancel_task_work(void)
|
|
|
f43afa |
{
|
|
|
f43afa |
struct __stp_tf_task_work *node;
|
|
|
f43afa |
+ struct __stp_tf_task_work *tmp;
|
|
|
f43afa |
unsigned long flags;
|
|
|
f43afa |
|
|
|
f43afa |
// Cancel all remaining requests.
|
|
|
f43afa |
spin_lock_irqsave(&__stp_tf_task_work_list_lock, flags);
|
|
|
f43afa |
- list_for_each_entry(node, &__stp_tf_task_work_list, list) {
|
|
|
f43afa |
+ list_for_each_entry_safe(node, tmp, &__stp_tf_task_work_list, list) {
|
|
|
f43afa |
// Remove the item from the list, cancel it, then free it.
|
|
|
f43afa |
list_del(&node->list);
|
|
|
f43afa |
stp_task_work_cancel(node->task, node->work.func);
|
|
|
f43afa |
--
|
|
|
f43afa |
1.8.3.1
|
|
|
f43afa |
|