diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-11-12 03:36:50 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-11-12 05:10:36 +0100 |
commit | 2789e6297f8fd4943b8d63599a75c3e1cf4f8517 (patch) | |
tree | 1b94b8ee15fbda78a165dd30286ff67b69bd42cf /net/mac802154 | |
parent | d14e1c71cfa870a2ed9f058a79b1c71decdaa9ba (diff) | |
download | linux-2789e6297f8fd4943b8d63599a75c3e1cf4f8517.tar.gz linux-2789e6297f8fd4943b8d63599a75c3e1cf4f8517.tar.bz2 linux-2789e6297f8fd4943b8d63599a75c3e1cf4f8517.zip |
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: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r-- | net/mac802154/iface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c index 8b21d201fc97..85d215562b4a 100644 --- a/net/mac802154/iface.c +++ b/net/mac802154/iface.c @@ -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); } |