提交 245cbe7a 编写于 作者: J Johannes Berg 提交者: John W. Linville

mac80211: fix key todo list order

When we add multiple todo entries, we rely on them being executed
mostly in the right order, especially when a key is being replaced.
But when a default key is replaced, the todo list order will differ
from the order when the key being replaced is not a default key, so
problems will happen. Hence, just move each todo item to the end of
the list when it is added so we can in the other code ensure that
hw accel for a key will be disabled before it is enabled for the
replacement.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b16bd15c
...@@ -74,9 +74,12 @@ static void add_todo(struct ieee80211_key *key, u32 flag) ...@@ -74,9 +74,12 @@ static void add_todo(struct ieee80211_key *key, u32 flag)
spin_lock(&todo_lock); spin_lock(&todo_lock);
key->flags |= flag; key->flags |= flag;
/* only add if not already added */ /*
if (list_empty(&key->todo)) * Remove again if already on the list so that we move it to the end.
list_add(&key->todo, &todo_list); */
if (!list_empty(&key->todo))
list_del(&key->todo);
list_add_tail(&key->todo, &todo_list);
schedule_work(&todo_work); schedule_work(&todo_work);
spin_unlock(&todo_lock); spin_unlock(&todo_lock);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册