提交 2789e629 编写于 作者: A Alexander Aring 提交者: Marcel Holtmann

mac820154: move mutex locks out of loop

Instead of always re-lock the iflist_mtx at multiple interfaces we lock
the complete for each loop at start and at the end.
Signed-off-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 d14e1c71
......@@ -540,11 +540,11 @@ void ieee802154_remove_interfaces(struct ieee802154_local *local)
{
struct ieee802154_sub_if_data *sdata, *tmp;
mutex_lock(&local->iflist_mtx);
list_for_each_entry_safe(sdata, tmp, &local->interfaces, list) {
mutex_lock(&sdata->local->iflist_mtx);
list_del(&sdata->list);
mutex_unlock(&sdata->local->iflist_mtx);
unregister_netdevice(sdata->dev);
}
mutex_unlock(&local->iflist_mtx);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册